# node-args

> Most minimalistic parameter processor for node.

Latest version **2.1.8** (published 2017-04-22) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.8 |
| Published | 2017-04-22 |
| First published | 2015-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Sándor Krisztián |
| Maintainers | christiansandor |
| Keywords | node-args, arg, argv, args, argument, arguments, parameter, parameters |

## Links

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

## 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

- 2.1.8 (latest) — 2017-04-22
- 2.1.7 — 2017-04-22
- 2.1.6 — 2017-04-18
- 2.1.5 — 2017-04-18
- 2.1.4 — 2017-04-18
- 2.1.3 — 2017-04-18
- 2.1.1 — 2017-04-18
- 2.1.0 — 2017-04-18
- 2.0.2 — 2017-04-18
- 2.0.0 — 2017-04-18
- 1.0.2 — 2015-09-07
- 1.0.1 — 2015-09-07
- 1.0.0 — 2015-09-07

## README

[![Build Status](https://travis-ci.org/christiansandor/args.svg?branch=master)](https://travis-ci.org/christiansandor/args)
[![Coverage Status](https://coveralls.io/repos/github/christiansandor/args/badge.svg?branch=master)](https://coveralls.io/github/christiansandor/args?branch=master)
[![NSP Status](https://nodesecurity.io/orgs/sandor-krisztian/projects/cc2b9197-5cdb-47b6-a17f-32642da55040/badge)](https://nodesecurity.io/orgs/sandor-krisztian/projects/cc2b9197-5cdb-47b6-a17f-32642da55040)

# Args
The most minimalistic parameter processor for node. Really.

## Usage
Couldn't be simpler, just install it like:
```
npm install node-args
```

And use it as:
```
var args = require('node-args');
```

 
### You're done.
No other options needed. *If you need more features, use [commander](https://www.npmjs.com/package/commander) or whatever else you fancy.*

### Call node with
- your named parameters prefixed with **--**
- your shorthand parameters prefixed with **-** (with multiple
  parameters in mind like `-ab = -a -b`)
- your parameters and assigned values separated with a
**space** or an **equals** sign

```
node my.js -t -ab=2 -c false -p no some additional data 2 --argsis awesome --another=1
```

So you will get:
```
{
    _: ['node', node file path],
    additional: ['some', 'additional', 'data', 2],
    t: true,
    a: 2,
    b: 2,
    c: false,
    p: 'no',
    argsis: 'awesome',
    another: 1
};
```

Yay.

*Side note: It's build upon TypeScript and tested thoroughly.*

## Build
The source files are in the *src* folder, and the available
scripts are
- `npm run build:src` to build without tests
- `npm run build:tests` to build with tests
- `npm test` to run tests

Please do contribute if you find a better, faster or easier way
to process arguments.

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