$ cnpm install cli-command-parser
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.
npm install --save cli-command-parser
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']
Copyright 2013 - present © cnpmjs.org | Home |