# exeq

> Excute shell commands in queue

Latest version **3.0.0** (published 2016-03-13) · MIT license · 0 weekly downloads

## Install

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

## 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 | 3.0.0 |
| Published | 2016-03-13 |
| First published | 2013-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 101 |
| Author | afc163 |
| Maintainers | afc163, ibigbug |
| Keywords | spawn, execute, exec, command, shell, promise, synchronously, bash, kill |

## Links

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

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

- 3.0.0 (latest) — 2016-03-13
- 2.4.0 — 2015-11-01
- 2.3.0 — 2015-11-01
- 2.2.0 — 2015-06-09
- 2.1.1 — 2015-05-04
- 2.1.0 — 2015-04-17
- 2.0.5 — 2015-04-15
- 2.0.4 — 2015-04-09
- 2.0.3 — 2015-04-03
- 2.0.2 — 2015-01-17
- 2.0.1 — 2015-01-15
- 2.0.0 — 2015-01-14
- 1.0.2 — 2014-08-12
- 1.0.1 — 2014-08-12
- 1.0.0 — 2014-07-21
- … 7 more at https://npm.io/package/exeq/versions

## README

# exeq

Excute shell commands in queue.

[![NPM version](https://img.shields.io/npm/v/exeq.svg?style=flat)](https://npmjs.org/package/exeq)
[![Build Status](https://img.shields.io/travis/afc163/exeq.svg?style=flat)](https://travis-ci.org/afc163/exeq)
[![David Status](https://img.shields.io/david/afc163/exeq.svg?style=flat)](https://david-dm.org/afc163/exeq)
[![NPM downloads](http://img.shields.io/npm/dm/exeq.svg?style=flat)](https://npmjs.org/package/exeq)

---

## Install

```bash
$ npm install exeq --save
```

## Usage

### exeq()

```js
exeq(
  'mkdir example',
  'rm -rf example'
);
```

### Promise `2.0.0+`

```js
// promise
exeq(
  'mkdir example',
  'cd example',
  'touch README.md',
  'touch somefile',
  'rm somefile',
  'ls -l',
  'cd ..',
  'rm -rf example',
  'ls -l > output.txt'
).then(function() {
  console.log('done!');
}).catch(function(err) {
  console.log(err);
});
```

### Array

```js
exeq([
  'mkdir example',
  'rm -rf example'
]);
```

### stdout & stderr

```js
exeq(
  'echo 123',
  'echo 456',
  'echo 789'
).then(function(results) {
  console.log(results[0].stdout); // '123'
  console.log(results[1].stdout); // '456'
  console.log(results[2].stdout); // '789'
});
```

```js
exeq(
  'not-existed-command'
).then(function(results) {
}).catch(function(err) {
  console.log(err); // { code: '127', stderr: ' ... ' }
});
```

### change cwd

```js
// cd command would change spawn cwd automatically
// create README.md in example
exeq(
  'mkdir example',
  'cd example',
  'touch README.md'
);
```

### Kill the execution

```js
var proc = exeq([
  'echo 1',
  'sleep 10',
  'echo 2'
]);
proc.q.kill();
```

### Events

```js
var proc = exeq([
  'echo 1',
  'echo 2'
]);

proc.q.on('stdour', function(data) {
  console.log(data);
});

proc.q.on('stderr', function(data) {
  console.log(data);
});

proc.q.on('killed', function(reason) {
  console.log(reason);
});

proc.q.on('done', function() {
});

proc.q.on('failed', function() {
});
```

## Test

```bash
$ npm test
```

## License

The MIT License (MIT)

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