# stereo

> The event emitter power kit.

Latest version **0.4.0** (published 2015-05-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install stereo
pnpm add stereo
yarn add stereo
bun add stereo
```

## 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.4.0 |
| Published | 2015-05-04 |
| First published | 2015-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Tomek Wiszniewski |
| Maintainers | tomekwi |
| Keywords | pubsub, publish, subscribe, event, emitter, multiplex, stream, mux, demux |

## Links

- npm: https://www.npmjs.com/package/stereo
- Repository: git@github.com:tomekwi/stereo
- Homepage: https://github.com/tomekwi/stereo
- Issues: https://github.com/tomekwi/stereo/issues
- npm.io page: https://npm.io/package/stereo

## Recent versions

- 0.4.0 (latest) — 2015-05-04
- 0.3.0 — 2015-04-24
- 0.2.0 — 2015-04-21
- 0.1.1 — 2015-04-17
- 0.1.0 — 2015-04-17
- 0.0.0-work-in-progress — 2015-04-15

## README

[![Coveralls – test coverage
](https://img.shields.io/coveralls/tomekwi/stereo.svg?style=flat-square)
](https://coveralls.io/r/tomekwi/stereo)
 [![Travis – build status
](https://img.shields.io/travis/tomekwi/stereo/master.svg?style=flat-square)
](https://travis-ci.org/tomekwi/stereo)
 [![David – status of dependencies
](https://img.shields.io/david/tomekwi/stereo.svg?style=flat-square)
](https://david-dm.org/tomekwi/stereo)
 [![Code style: airbnb
](https://img.shields.io/badge/code%20style-airbnb-blue.svg?style=flat-square)
](https://github.com/airbnb/javascript)




stereo
======

**The event emitter power kit.**  
**Supports multiple channels**  
**and promise-like caching.**

[*“EventEmitter compared to RxJS is analogous to roller blades versus cars.”*](http://futurice.com/blog/reactive-mvc-and-the-virtual-dom/) This is a super-lightweight “build your own vehicle” kit.

 

 

*stereo* is a super-lightweight alternative to RxJS. A collection of micro modules you can mix, match and extend.

Create your own slim and powerful event emitter.

*Note: I’m very tied up with work at the moment. I’m using this library in my own projects, but I still need a while to document it, do coverage reports, changelog and the marketing :) [Ideas and questions are very welcome](http://github.com/tomekwi/stereo/issues).*




Installation
------------

```sh
$ npm install stereo
```




Usage
-----


### The “batteries included” way

```js
import ø from 'stereo';

let myLibrary = 'anything';
Object.assign(myLibrary, ø());

myLibrary.on('channel one', console.log.bind(console))
  .emit('channel one', 'All arguments are passed on.', /Not kiddin'/);
//» All arguments are passed on. /Not kiddin'/

myLibrary.off('channel one')
  .emit('channel one', 'No-one’s listening anymore.');

// Boring? Don’t give up – read on!
```


### The “DIY” way

```js
import øEmit from 'stereo/emit';
import øWhen from 'stereo/when';

let myLibrary = 'anything';
myLibrary.emit = øEmit();
myLibrary.when = øWhen(myLibrary.emit);

// Miracles happen!

myLibrary.emit('channel one', 'Yay, this has been cached!');

// Time goes by...
myLibrary.when(
  ['channel one', 'channel two'],
  console.log.bind(console)
);
//» Yay, this has been cached!

myLibrary.emit(
  ['channel one', 'channel two', 'channel three']
  'This is called http://j.mp/demultiplexing .'
);
//» This is called http://j.mp/demultiplexing .
```




License
-------

[MIT][] © [Tomek Wiszniewski][]

[MIT]: ./License.md
[Tomek Wiszniewski]: https://github.com/tomekwi

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