Have ideas to improve npm?Join in the discussion! »

    arrgv

    1.0.2 • Public • Published

    Arrgv

    Parsing string to array of args like node on bash do.

    Build Status NPM version

    When you type something like node script.js bla bla bla in shell and do myArgs = process.argv.slice(2) you get the same. All slashes, quotes and special symbols are handled same way.

    Install

    npm install arrgv

    Tests

    $ npm test

    Use cases

    1. spawn a command that is given as a string
    2. test argv parser with complicated example string
    3. something else

    Example

    var arrgv = require('arrgv');
    var str = '-param --format="hh:mm:ss" filename.ext';
    console.log(arrgv(str));
    /*
    ['-param',
     '--format=hh:mm:ss',
     'filename.ext' ]
    */

    License

    MIT

    Install

    npm i arrgv

    DownloadsWeekly Downloads

    135,254

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    9.07 kB

    Total Files

    8

    Last publish

    Collaborators

    • avatar