# tiny-opts-parser

> A tiny options parser.

Latest version **0.0.3** (published 2017-05-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install tiny-opts-parser
pnpm add tiny-opts-parser
yarn add tiny-opts-parser
bun add tiny-opts-parser
```

## 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.0.3 |
| Published | 2017-05-22 |
| First published | 2016-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zachary Miller |
| Maintainers | zjmiller |

## Links

- npm: https://www.npmjs.com/package/tiny-opts-parser
- npm.io page: https://npm.io/package/tiny-opts-parser

## Recent versions

- 0.0.3 (latest) — 2017-05-22
- 0.0.2 — 2017-05-20
- 0.0.1 — 2016-10-26

## README

An extremely lightweight CLI options parser.

Install via npm or yarn

```console
> npm install --save tiny-opts-parser
```

And then just use `import` (or `require` if you need to):

```js
import parser from 'tiny-opts-parser';
```

In node, command line input is passed to application as an array. Tiny Opts Parser takes this array as its first argument, and an options object as its (optional) second argument. Tiny Opts Parser returns an object that maps the name of each argument or option to its value. The output will be exactly the same as the output of all the popular JS CLI parsers like Commander, Minimist, and Yargs.

For those who are new to CLI options parsing, the process can get quite complicated. For example, if someone types the following on the command line: `mycommand -a -bcd def xyz --abcd`, the parser needs to know turn this into the following object:
```js
{
  _: ['xyz'],
  a: true,
  b: true,
  c: true,
  d: 'def',
  abcd: true,
}
```

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