# forward-emitter

> Forward events from any Node EventEmitter to another EventEmitter.

Latest version **0.1.1** (published 2016-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install forward-emitter
pnpm add forward-emitter
yarn add forward-emitter
bun add forward-emitter
```

## 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.1 |
| Published | 2016-05-04 |
| First published | 2014-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Samuel Reed |
| Maintainers | strml |
| Keywords | eventemitter, events, forward |

## Links

- npm: https://www.npmjs.com/package/forward-emitter
- Repository: https://github.com/STRML/forward-emitter
- Issues: https://github.com/STRML/forward-emitter/issues
- npm.io page: https://npm.io/package/forward-emitter

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-05-04
- 0.1.0 — 2016-04-05
- 0.0.1 — 2014-06-30

## README

Forward-emitter
==============

Forward events from one Node EventEmitter to another.

Installation
------------

`npm install forward-emitter`

Usage
-----

```javascript
var forward = require('forward-emitter');

// Basic forwarding
forward(src, dest);

// Forward only selected events
// In this example, only the 'connect' event is forwarded.
forward(src, dest, function (eventName) {
  return eventName === 'connect';
});

// Forward all events except exclusions
var exclusions = ['connect', 'disconnect'];
forward(src, dest, function(eventName) {
  return exclusions.indexOf(eventName) === -1;
});

```

How It Works
------------

`forward-emitter` listens to the `newListener` and `removeListener` events, introduced in Node `0.8` and
Node `0.10` respectively. When a callback is bound to an event on the destination emitter, the listener
is forwarded to the source emitter.

For that reason, this module should not be used in Node `< 0.10` if you plan to use `removeListener`.

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