@zkochan/pnpm
Version:
A fast implementation of npm install
55 lines (33 loc) • 1.36 kB
Markdown

[](https://saucelabs.com/u/magnet-uri)
Works in node and the browser with [browserify](http://browserify.org/).
[](https://github.com/feross/standard)
```
npm install re-emitter
```
```js
var reemit = require('re-emitter')
var emitter = new EventEmitter()
var other = new EventEmitter()
reemit(emitter, other, ['foo', 'bar'])
other.on('foo', function () {
// foo will fire on other emitter!
})
emitter.emit('foo')
other.on('baz', function () {
// baz will not fire on other emitter
})
emitter.emit('baz')
```
`reemit` returns a `function`, which when called, cancels all re-emitting by removing the
event listeners which it added.
- Raynos
- Feross
MIT. Copyright (c) Raynos.