# args-flags

> A simple command line argument parser.

Latest version **1.1.1** (published 2022-04-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2022-04-23 |
| First published | 2022-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Travis Arnold |
| Maintainers | souporserious |

## Links

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

## Recent versions

- 1.1.1 (latest) — 2022-04-23
- 1.1.0 — 2022-04-23
- 1.0.0 — 2022-04-23
- 0.1.0 — 2022-04-23

## README

# args-flags

A simple command line argument parser.

## Install

```bash
yarn add args-flags
```

```bash
npm install args-flags
```

## Usage

```json
{
  "scripts": {
    "build": "node scripts/build.js README.mdx > README.md"
  }
}
```

Now we have access to the arguments and flags in `scripts/build.js` derived from `process.argv`:

```js
#!/bin/env node
import { args, flags } from 'args-flags'
import { watch } from 'chokidar'

const [optionOne, optionTwo] = args

if (flags.watch) {
  watch('./src').on('change', () => {
    console.log('source changed')
  })
}
```

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