eventemitter-light

0.2.2 • Public • Published

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

/eventemitter-light/

    Package Sidebar

    Install

    npm i eventemitter-light

    Weekly Downloads

    6

    Version

    0.2.2

    License

    none

    Last publish

    Collaborators

    • raynos