node package manager

eventemitter-light

Tiny event emitter

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