package
Split a string of arguments into an array
npm install argsplitGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Convert a string of arguments into an array
$ npm install --save argsplit$ npm test$ npm test -- --covIf you need to spawn a command that is given as a string
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' ]evanlucas
evanlucas@me.com