# executioner

> Executes provided shell commands with supplied arguments. Supports parallel and templated commands

Latest version **2.0.1** (published 2016-08-24) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.1 |
| Published | 2016-08-24 |
| First published | 2013-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Alex Indigo |
| Maintainers | alexindigo |
| Keywords | exec, shell, arguments, command, cli, execute |

## Links

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

## Dependencies (1)

- [mixly](https://npm.io/package/mixly.md) ^1.0.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

- 2.0.1 (latest) — 2016-08-24
- 2.0.0-beta1 — 2016-08-24
- 2.0.0 — 2016-08-24
- 1.2.0 — 2015-12-11
- 1.1.0 — 2015-12-07
- 1.0.1 — 2015-11-20
- 1.0.0 — 2015-11-20
- 0.0.1 — 2013-10-13

## README

# executioner  [![NPM Module](https://img.shields.io/npm/v/executioner.svg?style=flat)](https://www.npmjs.com/package/executioner)

Executes provided shell commands with supplied arguments. Supports parallel and templated commands.

[![Build Status](https://img.shields.io/travis/alexindigo/executioner/master.svg?style=flat-square)](https://travis-ci.org/alexindigo/executioner)
[![Coverage Status](https://img.shields.io/coveralls/alexindigo/executioner/master.svg?style=flat-square)](https://coveralls.io/github/alexindigo/executioner?branch=master)

[![Dependency Status](https://img.shields.io/david/alexindigo/executioner.svg?style=flat)](https://david-dm.org/alexindigo/executioner)
[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/executioner/badges/score.svg)](https://www.bithound.io/github/alexindigo/executioner)


*Notice of change of ownership: Starting version 1.0.0 this package has changed it's owner and goals. Old version (0.0.1) is still available on npm via `npm install executioner@0.0.1`. Thank you.*


## Install

```
npm install --save executioner
```

## Examples

```javascript
var executioner = require('executioner');
```

Simple command:

```javascript
executioner('echo A', {}, function(err, result)
{
  assert.equal(result, 'A');
});
```

Combined command:

```javascript
executioner(['echo A', 'echo B', 'echo C'], {}, function(err, result)
{
  assert.deepEqual(result, ['A', 'B', 'C']);
});
```

Parameterized command:

```javascript
executioner(['echo A-${abc}', 'echo B-${abc}', 'echo C-${xyz}', 'echo D-${xyz}'], {abc: '123', xyz: '789'}, function(err, result)
{
  assert.deepEqual(result, ['A-123', 'B-123', 'C-789', 'D-789']);
});
```

Named list of commands:

```javascript
executioner({'Letter A': 'echo A', 'Letter B': 'echo B', 'Letter C': 'echo C'}, {}, function(err, result)
{
  assert.deepEqual(result, ['Letter A: A', 'Letter B: B', 'Letter C: C']);
});
```

Prefixed commands:

```javascript
executioner(['A', 'B', 'C'], {}, {cmdPrefix: 'echo prefixed'}, function(err, result)
{
  assert.deepEqual(result, ['prefixed A', 'prefixed B', 'prefixed C']);
});
```

Non-string parameters:

```javascript
executioner(['echo A:${ok}:', 'echo B:${no}:', 'echo C:${nay}:', 'echo D:${never}:'], {ok: true, no: false, nay: null, never: undefined}, function(err, result)
{
  assert.deepEqual(result, ['A:1:', 'B::', 'C::', 'D::']);
});
```

Error messaging:

```javascript
executioner('echo ABC && echo XYZ 1>&2 && false', {}, function(err, result)
{
  assert.equal(err.message, 'Command failed: echo ABC && echo XYZ 1>&2 && false\nXYZ');
  assert.equal(err.stdout, 'ABC');
  assert.equal(err.stderr, 'XYZ');
  assert.equal(result, undefined);
});
```

Job termination:

```javascript
var job = executioner('echo ABC; sleep 5; echo XYZ', {}, function(err, result)
{
  assert.ok(err.terminated);
  // Partial output
  assert.equal(result, 'ABC');
});

setTimeout(function()
{
  executioner.terminate(job);
}, 100);
```

For more examples check out [`tests/tests.json`](tests/tests.json).

## License

Executioner is released under the [MIT](LICENSE) license.

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