Wildcard event emitter matching for nodejs
JavaScript CSS
Latest commit c0bd95e Apr 10, 2014 @tj tj Release 1.0.2
Failed to load latest commit information.
examples
test
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
package.json Release 1.0.2 Apr 10, 2014

Readme.md

wildcards

Wildcard event-emitter proxy for nodejs.

Installation

$ npm install wildcards
$ component install segmentio/wildcards

Example

var Emitter = require('events').EventEmitter;
var events = require('wildcards');

var app = new Emitter;

events(app, 'user:*', function(event, user){
  console.log('  %s %s', event, user);
});

app.emit('foo');
app.emit('bar');
app.emit('user:logout', 'tobi');
app.emit('user:login', 'loki');
app.emit('user:login', 'jane');

Yielding:

user:logout tobi
user:login loki
user:login jane

License

MIT