Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/segment-boneyard/proxy-events

Use https://github.com/segmentio/forward-events instead.
https://github.com/segment-boneyard/proxy-events

Last synced: about 5 hours ago
JSON representation

Use https://github.com/segmentio/forward-events instead.

Awesome Lists containing this project

README

        

# proxy-events

Proxy events from one emitter to another.

[![Build Status](https://travis-ci.org/segmentio/proxy-events.png?branch=master)](https://travis-ci.org/segmentio/proxy-events)

## Installation

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

## Example

```js
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