# @yme/argv

> argv parser

Latest version **0.1.2** (published 2022-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install @yme/argv
pnpm add @yme/argv
yarn add @yme/argv
bun add @yme/argv
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2022-07-22 |
| First published | 2022-07-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.16 |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | mino |
| Maintainers | minosss |
| Keywords | argv, parser, cli |

## Links

- npm: https://www.npmjs.com/package/@yme/argv
- Repository: https://github.com/minosss/argv
- Homepage: https://github.com/minosss/argv#readme
- Issues: https://github.com/minosss/argv/issues
- npm.io page: https://npm.io/package/@yme/argv

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

- 0.1.2 (latest) — 2022-07-22
- 0.1.1 — 2022-07-17
- 0.1.0 — 2022-07-17

## README

# argv [![v](https://img.shields.io/npm/v/@yme/argv?color=5755d9&label=)](https://www.npmjs.com/package/@yme/argv)

**tips**

- all starts with `--`
- no boolean like `--foo=true` use `--foo` or `--no-foo`
- supports string array `--filter=pkg/* --filter=ext/*` returns `{filter: ['pkg/*', 'ext/*']}`
- after `--` will save to `__`
- the same key overwrites the previous one, excepts for string

Install

```sh
pnpm add @yme/argv
```

Usage

```js
import parser from '@yme/argv';

const argv = parser(process.argv.slice(2));
// => {_: [...], ...}

const hello = parser(['--have', '--a', '--good=6', '--day=today', '--no-bad', 'banana']);
// => {_: ['banana'], have: true, a: true, good: 6, day: 'today', bad: false}

// duplicate keys
const arr = parser(['--filter=packages/*', '--filter=exts/*']);
// => {filter: ['packages/*', 'exts/*']}

const overwrite = parser(['--foo', '--no-foo', '--bar', '--bar=bar']);
// => {foo: false, bar: 'bar'}

// camelcase key
const k = parser(['--foo-bar']);
// => {fooBar: true}
```

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