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

install

npm i argsplit

Downloadsweekly downloads

505

version

1.0.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
Report a vulnerability