miniee

0.0.5 • Public • Published

MiniEE

MiniEE is a client and server side library for routing events.

The main difference from EventEmitter is that callbacks can be specified using RegExps.

Works on the client and the server.

Installing:

npm install miniee

Using:

var MiniEE = require('miniee');
var MyClass = function() {};
MiniEE.mixin(MyClass);

var obj = new MyClass();    
// set string callback
obj.on('event', function(arg1, arg2) { console.log(arg1, arg2); });
obj.emit('event', 'aaa', 'bbb'); // trigger callback

// set regexp callback
obj.on(/event.*/, function(arg) { console.log(arg); });
// trigger regexp callback
obj.emit('event-123', 'aaa', 'bbb');

See also:

http://nodejs.org/api/events.html

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.510latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.510
0.0.20
0.0.10

Package Sidebar

Install

npm i miniee

Weekly Downloads

10

Version

0.0.5

License

none

Last publish

Collaborators

  • mixu