$ npm install arrgv
Parsing string to array of args like node on bash do.
When you type something like node script.js bla bla bla
in shell and do myArgs = process.argv.slice(2)
you get the same. All slashes, quotes and special symbols are handled same way.
npm install arrgv
$ npm test
spawn
a command that is given as a stringargv
parser with complicated example stringvar arrgv = require('arrgv');
var str = '-param --format="hh:mm:ss" filename.ext';
console.log(arrgv(str));
/*
['-param',
'--format=hh:mm:ss',
'filename.ext' ]
*/
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE