# gaffle

> Run many commands based on arguments to one npm script

Latest version **0.1.5** (published 2017-01-14) · MIT license · 0 weekly downloads

## Install

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

Provides the command `gaffle`.

## 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.1.5 |
| Published | 2017-01-14 |
| First published | 2016-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Oskar Thornblad |
| Maintainers | prewk |

## Links

- npm: https://www.npmjs.com/package/gaffle
- Repository: https://github.com/prewk/gaffle
- Issues: https://github.com/prewk/gaffle/issues
- npm.io page: https://npm.io/package/gaffle

## Dependencies (4)

- [json5](https://npm.io/package/json5.md) ^0.5.1
- [colors](https://npm.io/package/colors.md) ^1.1.2
- [find-up](https://npm.io/package/find-up.md) ^2.1.0
- [find-package-json](https://npm.io/package/find-package-json.md) ^1.0.0

## Recent versions

- 0.1.5 (latest) — 2017-01-14
- 0.1.4 — 2017-01-14
- 0.1.3 — 2017-01-14
- 0.1.2 — 2017-01-14
- 0.1.1 — 2017-01-14
- 0.1.0 — 2017-01-14
- 0.0.5 — 2016-12-29
- 0.0.4 — 2016-12-29
- 0.0.3 — 2016-12-29
- 0.0.2 — 2016-12-13
- 0.0.1 — 2016-12-13

## README

# Gaffle

## Installation

`npm install --save-dev gaffle`

## Example

Add this to your `package.json`:

```json
{
  "scripts": {
    "test": "gaffle"
  },
  "gaffle": {
    "jest": { "cmd": "jest $0", "env": { "NODE_ENV": "test" } },
    "jest": { "cmd": "jest --watch", "env": { "NODE_ENV": "test" } },
    "flow": "flow check $0"
  }
}
```

Usage: `npm test jest` / `npm test jest watch` / `npm test flow`.

## Why?

For organizing advanced scripts in `package.json` into simpler commands, and being able to run them via special commands such as `npm test` that suppresses some annoying output.

## Config schema

```json
{
  "<short-hand command 1>": "<actual command>",
  "<short-hand command 2>": {
    "cmd": "<actual command>",
    "env": {
      "SOME_ENV_VAR": "<env var value>"
    },
    "desc": "<Description of the command>"
  },
  "<short-hand command 3>": "<actual command> $0 $1",
  "<short-hand command 4>": "<actual command> $*"
}
```

Running an invalid short-hand command (or no command) yields a **help** output that lists the commands

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