argsplit
v1.0.5
Published
Split a string of arguments into an array
Downloads
12,173
Readme
argsplit
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' ]