# exargs

> Argument expansion utility.

Latest version **1.0.0** (published 2019-06-26) · MIT license · 0 weekly downloads

## Install

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

Provides the command `exargs`.

## 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.0.0 |
| Published | 2019-06-26 |
| First published | 2019-06-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ben Teichman |
| Maintainers | effervescentia |

## Links

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

## Dependencies (3)

- [dargs](https://npm.io/package/dargs.md) ^7.0.0
- [read-pkg](https://npm.io/package/read-pkg.md) ^5.1.1
- [commander](https://npm.io/package/commander.md) ^2.20.0

## Recent versions

- 1.0.0 (latest) — 2019-06-26

## README

# exargs

> Expand your arguments, expand your mind.

Basically a cli wrapper for [`dargs`](npm.im/dargs) that allows you to easily externalize arguments and flags
for passing to cli's that don't support `.*rc` or other configuration files.

## Installation

```sh
npm install --save-dev exargs
# or
yarn add exargs
```

## Usage

This utility depends on argument expansion in order to work properly.

```json
// package.json

{
  "scripts": {
    "start:long": "mycmd --with=alot,of,arguments,oh,so,long --why=do,i,have,all,of,this,in,here --what=have,i,done,to,deserve,this",
    "start:short": "mycmd $(exargs .mycmdrc)"
  }
}
```

```json
// .mycmdrc

{
  "with": "alot,of,arguments,oh,so,long",
  "why": "do,i,have,all,of,this,in,here",
  "what": "have,i,done,to,deserve,this"
}
```

### Options

All of the options accepted by [`dargs`](npm.im/dargs) can be passed to `exargs`. The only way to pass these options currently is to add a `$` property to the configuration file you have specified.

```json
// .mycmdrc

{
  "$": {
    "combine": ["property"]
  },

  "property": ["one", "two"]
}
```

There are also some options added to make `exargs` more configurable:

- `combine` _Array_ - specify fields which should be rolled up into a single string to avoid `dargs` generating multiple arguments.

#### `combine`

Without `combine`:

```json
{
  "with": ["alot", "of", "arguments", "oh", "so", "long"]
}

// yields: --with=alot --with=of --with=arguments --with=oh --with=so --with=long
```

With `combine`:

```json
{
  "$": {
    "combine": ["with"]
  },
  "with": ["alot", "of", "arguments", "oh", "so", "long"]
}

// yields: --with=alot --with=of --with=arguments --with=oh --with=so --with=long
```

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