cline-parser

1.0.3 • Public • Published

cline-parser

Mac/Linux Windows

Build Status | Windows Build status

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    1
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i cline-parser

Weekly Downloads

1

Version

1.0.3

License

WTF

Last publish

Collaborators

  • maboiteaspam