You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cli-command-parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-command-parser

Parse cli commands in a string intended for child_process#spawn

1.0.3
latest
Source
npmnpm
Version published
Weekly downloads
98
13.95%
Maintainers
1
Weekly downloads
 
Created
Source

cli-command-parser Build Status

Parses a string that is intended for child_process#spawn and returns an array with the first value being the command to execute and the rest of the array containing separated arguments.

It can handle escape sequences as well as quotes.

Install

npm install --save cli-command-parser

Usage

var cliCommandParser = require('cli-command-parser');
console.log(cliCommandParser('ls -lh'));

// outputs ['ls', '-lh']

console.log(cliCommandParser('foo "some options" --test'));

// outputs ['foo', 'some options', '--test']

Keywords

cli

FAQs

Package last updated on 14 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts