It's a light event emitter
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
test
.travis.yml
LICENCE
Makefile
README.md
package.json

README.md

eventemitter-light Build Status

Tiny event emitter for node and the browser

Status: Beta

Example

var EventEmitter = require("eventemitter-light");

var ee = Object.create(EventEmitter).constructor();

ee.on('foo.namespaces', logFoo);
ee.emit('foo.namespaces');

function logFoo() {
    console.log('foo');
}

Motivation

EventEmitter2 is 2kb. That's far too much. EE-light is a sensible 250bytes

Documentation

It's like EventEmitter build into node.

ee.on("foo", works)

ee.emit('foo');
// works

function works() { console.log('works'); }

Supported methods

  • on
  • emit
  • removeListener
  • once

Installation

npm install eventemitter-light

Test

make test

Contributors

  • Raynos

MIT Licenced