# @dot-event/arg

> dot-event cli and url arguments

Latest version **0.0.8** (published 2019-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dot-event/arg
pnpm add @dot-event/arg
yarn add @dot-event/arg
bun add @dot-event/arg
```

## 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.8 |
| Published | 2019-03-13 |
| First published | 2019-02-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | dot-event |
| Maintainers | winton |
| Keywords | event, cli, url, arguments |

## Links

- npm: https://www.npmjs.com/package/@dot-event/arg
- Repository: https://github.com/dot-event/arg
- Homepage: https://github.com/dot-event/arg#readme
- Issues: https://github.com/dot-event/arg/issues
- npm.io page: https://npm.io/package/@dot-event/arg

## Dependencies (1)

- [getopts](https://npm.io/package/getopts.md) 2.2.3

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.8 (latest) — 2019-03-13
- 0.0.7 — 2019-03-12
- 0.0.6 — 2019-03-11
- 0.0.5 — 2019-03-11
- 0.0.4 — 2019-02-09
- 0.0.3 — 2019-02-09
- 0.0.2 — 2019-02-03

## README

# @dot-event/arg

[dot-event](https://github.com/dot-event/dot-event#readme) cli and url arguments

![orbs](orbs.gif)

## Install

```bash
npm install dot-event @dot-event/arg @dot-event/store
```

## Setup

```js
const dot = require("dot-event")()
require("@dot-event/arg")(dot)
require("@dot-event/store")(dot)
```

## Auto-detect arguments

```js
const args = dot.arg() // detects args from `process.argv` or `window.location`
args // { _: ["arg"], opt: true }
```

## Manual arguments

```js
const args = dot.arg({
  args: ["arg", "-o"],
  alias: { o: ["opt"] },
})
args // { _: ["arg"], o: true, opt: true }
```

## Options

| Option | Description                                                     |
| ------ | --------------------------------------------------------------- |
| `save` | Save args to [store](https://github.com/dot-event/store#readme) |

## Credits

This project uses [getopts](https://github.com/jorgebucaran/getopts) for argument parsing.

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