Socket
Socket
Sign inDemoInstall

re-emitter

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    re-emitter

Re emit events from another emitter


Version published
Weekly downloads
26K
decreased by-12.25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

re-emitter travis npm downloads javascript style guide

Re emit events from another emitter

reemit

Sauce Test Status

Works in node and the browser with browserify.

js-standard-style

install

npm install re-emitter

usage

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')
canceling re-emitting

reemit returns a function, which when called, cancels all re-emitting by removing the event listeners which it added.

contributors

  • Raynos
  • Feross

license

MIT. Copyright (c) Raynos.

Keywords

FAQs

Last updated on 28 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc