argsplit

Split a string of arguments into an array

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
argsplit
011.0.57 years ago9 years agoMinified + gzip package size for argsplit in KB

Readme

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' ]