cli-command-parser

Parse cli commands in a string intended for child_process#spawn

ISC 3 个版本
安装
npm install cli-command-parser
yarn add cli-command-parser
pnpm add cli-command-parser
bun add cli-command-parser
README

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']
版本列表
1.0.3 2015-09-14
1.0.2 2015-09-11
1.0.1 2015-09-11