Listen in on what event emitters are doing
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.travis.yml
README.md
index.js
package.json
test.js

README.md

Nosy Neighbor

Build
Status

Listen in on what event emitters are doing.

Usage

var callback = function(event, args) {
  // Do something
}

var emitter1 = new EventEmitter();
    emitter2 = new EventEmitter();

var neighbor = new NosyNeighbor(callback);

neighbor.peek(emitter1);
neighbor.peek(emitter2);

When you emit an event.

emitter1.emit('msg', 'brandon', 'farmer');

callback with be called with 'msg' as event and ['brandon', 'farmer'] as args.

It will also listen to both emitters, so emitting from emitter2 will result in the same outcome.