# event-relay

> A little module for proxying events through arbitrary emitters.

Latest version **0.0.3** (published 2017-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install event-relay
pnpm add event-relay
yarn add event-relay
bun add event-relay
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2017-07-04 |
| First published | 2013-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Rhodes |
| Maintainers | michaelrhodes |
| Keywords | event, proxy |

## Links

- npm: https://www.npmjs.com/package/event-relay
- Repository: git@github.com:michaelrhodes/event-relay
- Homepage: https://github.com/michaelrhodes/event-relay
- Issues: https://github.com/michaelrhodes/event-relay/issues
- npm.io page: https://npm.io/package/event-relay

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 0.0.3 (latest) — 2017-07-04
- 0.0.2 — 2013-11-13
- 0.0.1 — 2013-11-13
- 0.0.0 — 2013-11-13

## README

# event-relay
event-relay is a little module for proxying events through arbitrary emitters. It will work with any event emitter implementation (EventEmitter, emitter-component, asEvented, etc) that exposes an emit() method.

[![Build status](https://travis-ci.org/michaelrhodes/event-relay.png?branch=master)](https://travis-ci.org/michaelrhodes/event-relay)

[![Browser support](https://ci.testling.com/michaelrhodes/event-relay.png)](https://ci.testling.com/michaelrhodes/event-relay)

## Install

``` sh
$ npm install event-relay
```

## API
``` 
event-relay(

  event (string):
    the name of the event that
    will be emitted

  emitter (event_emitter):
    the proxy who will emit the
    aforementioned event. must 
    have an emit() method

)
```

## Usage
``` js
var EventEmitter = require('events').EventEmitter
var relay = require('event-relay')

var source = new EventEmitter
var proxy = new EventEmitter

proxy.on('relayed-event', function(data) {
  // { some: 'data' }
})

source.on('event', relay('relayed-event', proxy))
source.emit('event', { some: 'data' })
```

### License
[MIT](http://opensource.org/licenses/MIT)

---
_Source: https://npm.io/package/event-relay · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
