# get-them-args

> Parse argument options

Latest version **1.3.2** (published 2018-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-them-args
pnpm add get-them-args
yarn add get-them-args
bun add get-them-args
```

## 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 | 1.3.2 |
| Published | 2018-07-15 |
| First published | 2016-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Tiaan du Plessis |
| Maintainers | tiaanduplessis |
| Keywords | args, get-them-args, parser, arguments |

## Links

- npm: https://www.npmjs.com/package/get-them-args
- Repository: https://github.com/tiaanduplessis/get-them-args
- Issues: https://github.com/tiaanduplessis/get-them-args/issues
- npm.io page: https://npm.io/package/get-them-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

- 1.3.2 (latest) — 2018-07-15
- 1.3.1 — 2017-08-15
- 1.3.0 — 2017-07-18
- 1.2.2 — 2017-04-23
- 1.2.1 — 2017-03-14
- 1.2.0 — 2017-03-13
- 1.1.1 — 2017-03-13
- 1.0.1 — 2017-01-21
- 1.0.0 — 2016-12-17

## README

# get-them-args
[![package version](https://img.shields.io/npm/v/get-them-args.svg?style=flat-square)](https://npmjs.org/package/get-them-args)
[![package downloads](https://img.shields.io/npm/dm/get-them-args.svg?style=flat-square)](https://npmjs.org/package/get-them-args)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![package license](https://img.shields.io/npm/l/get-them-args.svg?style=flat-square)](https://npmjs.org/package/get-them-args)
[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Greenkeeper badge](https://badges.greenkeeper.io/tiaanduplessis/get-them-args.svg)](https://greenkeeper.io/)

> Parse argument options

## Table of Contents

- [About](#about)
- [Install](#install)
- [Usage](#usage)
- [Contribute](#contribute)
- [License](#License)


## About

Simple CLI argument parser hacked from [minimist](https://github.com/substack/minimist) that adds support for objects and additional initialization options.

## Install

```sh
$ npm install --save get-them-args
# Or
$ yarn add get-them-args
```

## Usage
To use, provide arguments as argument:

```js
const parse = require('get-them-args')
const options = {} // Options to be passed. CURRENTLY NONE AVAILABLE

// $ node ./example.js --dir . --command foo
console.log(parse(process.argv.slice(2) ))
// { unknown: [], dir: '.', command: 'foo' }

console.log(parse(process.argv))
// { unknown: [], dir: '.', command: 'foo' }

console.log(parse())
// { unknown: [], dir: '.', command: 'foo' }

```

For example, if the arguments provided are `--hello world --parse=all --no-drugs --make-friends -n 4 -t 5`, the function will return:

```js
{ unknown: [],
  hello: 'world',
  parse: 'all',
  drugs: false,
  'make-friends': true,
  n: 4,
  t: 5
}

```

There is also support for parsing objects:

```sh

$ node example.js --headers={"Foo": "5", "bar": "6"}
# { unknown: [], headers: { Foo: 5, bar: 6 } }

```

All unparsed arguments will end up in the `unknown` array. The following types of arguments are supported:

```sh
--key=value
--key value
--key # true
--no-key # false
-key=value
-key value
```

## Contribute

1. Fork it and create your feature branch: git checkout -b my-new-feature
2. Commit your changes: git commit -am 'Add some feature'
3. Push to the branch: git push origin my-new-feature 
4. Submit a pull request

## License

MIT

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