re-emitter

Re emit events from another emitter

npm install re-emitter
2 downloads in the last day
34 downloads in the last week
91 downloads in the last month

re-emitter

Re emit events from another emitter

Example

var EventEmitter = require("events").EventEmitter
    , ReEmitter = require("re-emitter")

var emitter = new EventEmitter()
    , other = ReEmitter(emitter, ["foo", "bar"])

other.on("foo", function () {
    console.log("fired")
})

other.on("baz", function () {
    console.log("should not fire")
})

emitter.on("bar", function () {
    console.log("should not fire")
})

emitter.emit("foo")
emitter.emit("baz")
other.emit("bar")

Installation

npm install re-emitter

Contributors

  • Raynos

MIT Licenced

npm loves you