npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

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

Keywords

none

install

npm i cline-parser

Downloadsweekly downloads

5

version

1.0.3

license

WTF

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability