# commandificator

> Small utility to create a command line utility from an array of functions

Latest version **1.0.7** (published 2021-08-11) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-08-11 |
| First published | 2021-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nuño Sempere |
| Maintainers | lokiodinevich |
| Keywords | Simple, command, line |

## Links

- npm: https://www.npmjs.com/package/commandificator
- Repository: https://github.com/NunoSempere/commandificator
- Homepage: https://github.com/NunoSempere/commandificator#readme
- Issues: https://github.com/NunoSempere/commandificator/issues
- npm.io page: https://npm.io/package/commandificator

## Dependencies (1)

- [readline](https://npm.io/package/readline.md) ^1.3.0

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

- 1.0.7 (latest) — 2021-08-11
- 1.0.6 — 2021-08-11
- 1.0.5 — 2021-08-11
- 1.0.4 — 2021-08-11
- 1.0.3 — 2021-08-11
- 1.0.2 — 2021-08-11
- 1.0.1 — 2021-08-11
- 1.0.0 — 2021-08-11

## README

# Commandificator
A narrow tool which turns a list of functions into a command line prompt. For a more featureful solution, see e.g., [commander](https://www.npmjs.com/package/commander).

## Installation

```
$ npm install commandificator
```

## Example use

```js
// Inside index.js
import commandify from "commandify"

let echo = (x)=> console.log(x)
let echo0 = () => echo(0)
let echo1 = () => echo(1)
let echo2 = () => echo(2)
let echo3 = () => echo(3)
let echo4 = () => echo(4)

let functions = [echo0, echo1, echo2, echo3, echo4]
commandify(functions)
```

```
$ node index.js
[0]: Run echo0
[1]: Run echo1
[2]: Run echo2
[3]: Run echo3
[4]: Run echo4
Choose one option, wisely: #1
1
$ node index.js 2
2
$ npm run start 2
2
```

Commandificator also takes an optional `message` argument.

```js
import commandify from "commandify"

let echo = (x)=> console.log(x)
let echo0 = () => echo("0")
let echo1 = () => echo("1")

let functions = [echo0, echo1]
let message = "[0/1]: "

commandify(functions, message)
```

```
$ node test.js
[0/1]: 1
1
```

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