# spawn-args

> Turn a string of command line options into an array for child_process.spawn

Latest version **0.2.0** (published 2016-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install spawn-args
pnpm add spawn-args
yarn add spawn-args
bun add spawn-args
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-06-30 |
| First published | 2014-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 15 |
| Author | Kai Davenport |
| Maintainers | binocarlos |
| Keywords | spawn, argv, parser |

## Links

- npm: https://www.npmjs.com/package/spawn-args
- Repository: https://github.com/binocarlos/spawn-args
- Issues: https://github.com/binocarlos/spawn-args/issues
- npm.io page: https://npm.io/package/spawn-args

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2016-06-30
- 0.1.0 — 2015-05-18
- 0.0.4 — 2014-07-23
- 0.0.3 — 2014-07-22
- 0.0.2 — 2014-04-05

## README

spawn-args
==========

![Build status](https://api.travis-ci.org/binocarlos/spawn-args.png)

Turn a string of command line options into an array for child_process.spawn

## install

```
$ npm install spawn-args
```

## usage

```js
var spawnargs = require('spawn-args');
//spawnargs(argString:string[, options:object]);

var args = spawnargs('-port 80 --title "this is a title"');

/*

	[
		'-port',
		'80',
		'--title',
		'"this is a title"'
	]
	
*/
```

The `removequotes` option will remove quotes from values if they do not have spaces

```js
var args2 = spawnargs('-port 80 --color "red" --title "this is a title"', { removequotes: true });

/*

	[
		'-port',
		'80',
		'--title',
		'"this is a title"'
	]
	
*/
```

If `removequotes` is `always` then quotes will be removed even if the value contains spaces

```js
var args3 = spawnargs('-port 80 --color "red" --title "this is a title"', { removequotes: 'always' });

/*

	[
		'-port',
		'80',
		'--title',
		'this is a title'
	]
	
*/
```

## license

MIT

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