Skip to content

segment-boneyard/proxy-events

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

proxy-events

Proxy events from one emitter to another.

Build Status

Installation

$ npm install proxy-events
$ component install segmentio/proxy-events

Example

var Emitter = require('events').EventEmitter;
var proxy = require('proxy-events');

var app = new Emitter;
var subapp = new Emitter;

proxy(subapp, app);

app.on('foo', console.log);

subapp.emit('foo', 'bar');
// "bar"

API

proxy(one, another, [prefix])

Proxy events from one emitter to another with an optional prefix.

License

MIT