cline-parser
v1.0.3
Published
simple command line parser
Downloads
5
Readme
cline-parser
Mac/Linux | Windows ---- | ---- |
A library to parse a string command line into an array usable by child_process.spawn
Install
npm i cline-parser --save
Usage
var parser = require('cline-parser');
var cmdStr = 'ls "some path / \\"with /spaces" -args';
var cmd = parser(cmdStr);
// this is what you could actually do.
require('child_process').spawn(cmd.prg,{},cmd.args);
// quick insights.
cmd.prg == 'ls';
cmd.args == [
'some path / \\"with /spaces',
'-args'
];