# cli-command-parser

> Parse cli commands in a string intended for child_process#spawn

Latest version **1.0.3** (published 2015-09-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install cli-command-parser
pnpm add cli-command-parser
yarn add cli-command-parser
bun add cli-command-parser
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2015-09-14 |
| First published | 2015-09-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Michael Leaney |
| Maintainers | leahcimic |
| Keywords | cli, command, arguments, parser, flags |

## Links

- npm: https://www.npmjs.com/package/cli-command-parser
- Repository: https://github.com/leahciMic/cli-command-parser
- Homepage: https://github.com/leahciMic/cli-command-parser#readme
- Issues: https://github.com/leahciMic/cli-command-parser/issues
- npm.io page: https://npm.io/package/cli-command-parser

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2015-09-14
- 1.0.2 — 2015-09-11
- 1.0.1 — 2015-09-11

## README

# cli-command-parser [![Build Status](https://travis-ci.org/leahciMic/cli-command-parser.svg?branch=master)](https://travis-ci.org/leahciMic/cli-command-parser)

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

```sh
npm install --save cli-command-parser
```

## Usage

```js
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']
```

---
_Source: https://npm.io/package/cli-command-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
