# pargser

> A CLI argument parser.

Latest version **1.0.4** (published 2019-02-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install pargser
pnpm add pargser
yarn add pargser
bun add pargser
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2019-02-26 |
| First published | 2019-02-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hayden Higginbotham |
| Maintainers | haydenhigg |
| Keywords | arguments, argv, parser |

## Links

- npm: https://www.npmjs.com/package/pargser
- npm.io page: https://npm.io/package/pargser

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

- 1.0.4 (latest) — 2019-02-26
- 1.0.3 — 2019-02-25
- 1.0.2 — 2019-02-25
- 1.0.1 — 2019-02-25
- 1.0.0 — 2019-02-25

## README

# pargser

This is a friendly command-line argument parser.

## Test

```sh
$ npm test
```

## Usage

```javascript
const Argvments = require('pargser');

const args = new Argvments(process.argv);

console.log(args.argArray) // process.argv without the first two entries
console.log(args.argString) // joined arg array

console.log(args.file) // script/program name

console.log(args.__args) // object with parsed arguments

console.log(args.get("argumentKey", "fallback if key doesn't exist (null is default)")); // get value of argument ("beginning '--' and '-' are stripped, so you can't have all three keys "argument-key", "-argument-key", and "--argument-key")
```

- Booleans ("true"/"false") in the arguments are parsed to their respective values.
- "null" and "nil" are parsed to null.
- Numbers (can deal with commas and decimals in numbers) are parsed to their respective value.
- Prepending "-no" to the beginning of a switch sets it to false rather than true in __args.
- Key names are converted to camel-case.
- Flags can be used with equals signs (`... --this-flag=false`) or without (`... --this-flag false`)

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