# args-manager

> manage arguments used in .spawn(), .execFile() and their siblings

Latest version **2.0.1** (published 2017-01-04) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.1 |
| Published | 2017-01-04 |
| First published | 2016-11-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | rogerbf |
| Maintainers | rogerbf |
| Keywords | spawn, spawnSync, execFile, execFileSync, fork, child_process, arguments, args |

## Links

- npm: https://www.npmjs.com/package/args-manager
- Repository: https://github.com/rogerbf/args-manager
- Homepage: https://github.com/rogerbf/args-manager#readme
- Issues: https://github.com/rogerbf/args-manager/issues
- npm.io page: https://npm.io/package/args-manager

## Recent versions

- 2.0.1 (latest) — 2017-01-04
- 2.0.0 — 2016-11-16
- 1.0.0 — 2016-11-15

## README

# args-manager

Manage arguments used in `.spawn()`, `.execFile()` and their siblings.

## usage

```javascript
import createManager from 'args-manager'

const args = createManager()

args.add({ SocksPort: 9050 })
args.add({ Name: `Two Forks` })
args.add(`--start`)

args()
// [`SocksPort`, 9050, `Name`, `Two Forks`, `--start`]

args.clear()
args()
// []
```

## options

```javascript
const args = createManager({
  args: [`SocksPort`, 9050, { Lookout: `Thorofare` }],
  validArgs: (
    fs.execFileSync(`tor`, [`--list-torrc-options`])
    .trim()
    .split(`\n`)
  ),
  build: (args) => args,
  validate: (validArgs, arg) => {
    if (typeof (arg) === `string`) {
      return arg
    } else {
      throw new Error(`expected arg to be a string`)
    }
  }
})
```

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