# event-pipeline

> A simple event emitter that processes events in order

Latest version **2.1.0** (published 2019-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install event-pipeline
pnpm add event-pipeline
yarn add event-pipeline
bun add event-pipeline
```

## 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.1.0 |
| Published | 2019-12-17 |
| First published | 2017-06-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Dan VerWeire |
| Maintainers | wankdanker |

## Links

- npm: https://www.npmjs.com/package/event-pipeline
- Repository: https://github.com/wankdanker/event-pipeline
- Homepage: https://github.com/wankdanker/event-pipeline#readme
- Issues: https://github.com/wankdanker/event-pipeline/issues
- npm.io page: https://npm.io/package/event-pipeline

## Dependencies (1)

- [usey](https://npm.io/package/usey.md) ^1.9.1

## Recent versions

- 2.1.0 (latest) — 2019-12-17
- 2.0.0 — 2019-05-28
- 1.3.0 — 2019-05-16
- 1.2.0 — 2019-04-10
- 1.1.0 — 2018-06-14
- 1.0.1 — 2017-06-20
- 1.0.0 — 2017-06-20

## README

event-pipeline
--------------

This module provides an event-emitter like class that processes registered
event handlers in order and returns a callback to the emit call when all events
have been called. If an event handler passes an error to the callback function
then no further event handlers will be called.

example
-------

```js
var EventPipeline = require('event-pipeline');

var e = new EventPipeline();

e.on('get:before', function (arg1, arg2, cb) {
  /* stuff */

  return cb();
})

e.on('get:before', function (arg1, arg2, cb) {
  /* stuff */

  return cb();
})

var a = {};
var b = {};

e.emit('get:before', a, b, function (err, a, b) {
  //done
});
```

api
---

* EventPipeline() - constructor function
* on(eventName, listener) - register a listener
  * eventName - the event name to register
  * listener - the function to call when eventName is emitted
* on.unshift(eventName, listener) - insert a listener to the beginning of the list of listeners
  * eventName - the event name to register
  * listener - the function to call when eventName is emitted
* off(eventName, listener) - unregister a listener
  * eventName - the event name that was previously registered
  * listener - the function that was previously registered
* emit(eventName[, arg1][, arg2][, ...][, callback]) - emit an event
  * arg1, ... - all arguments are passed to the event listener
  * callback - this function is called when all events have been processed or
  one of them called back with an error

license
-------

MIT

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