Need private packages and team management tools?Check out npm Teams »

cli-command-parser

1.0.3 • Public • Published

cli-command-parser Build Status

Parses a string that is intended for child_process#spawn and returns an array with the first value being the command to execute and the rest of the array containing separated arguments.

It can handle escape sequences as well as quotes.

Install

npm install --save cli-command-parser

Usage

var cliCommandParser = require('cli-command-parser');
console.log(cliCommandParser('ls -lh'));
 
// outputs ['ls', '-lh']
 
console.log(cliCommandParser('foo "some options" --test'));
 
// outputs ['foo', 'some options', '--test']

Install

npm i cli-command-parser

DownloadsWeekly Downloads

87

Version

1.0.3

License

ISC

Last publish

Collaborators

  • avatar