Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (37 sloc) 905 Bytes

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