argsplit

1.0.5 • Public • Published

argsplit

Build Status Coverage Status

Convert a string of arguments into an array

Install

$ npm install --save argsplit

Tests

$ npm test

Coverage

$ npm test -- --cov

Use cases

If you need to spawn a command that is given as a string

Example

var argsplit = require('argsplit')
var input = 'npm config set init.author.name "Evan Lucas" --verbose'
var out = argsplit(input)
console.log(out)
var cmd = out.shift()   // => 'npm'
spawn(cmd, out)

Will return the following:

['npm',
 'config',
 'set',
 'init.author.name',
 '"Evan Lucas"',
 '--verbose' ]

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i argsplit

    Weekly Downloads

    21,928

    Version

    1.0.5

    License

    MIT

    Last publish

    Collaborators

    • eh
    • evanlucas