1.0.3 • Published 9 years ago

cline-parser v1.0.3

Weekly downloads
7
License
WTF
Repository
github
Last release
9 years ago

cline-parser

Mac/LinuxWindows

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

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago