Wildcard event emitter matching for nodejs
JavaScript CSS
Switch branches/tags
Nothing to show
Latest commit c0bd95e Apr 10, 2014 @tj tj Release 1.0.2
Permalink
Failed to load latest commit information.
examples
test Make .emit chainable Apr 10, 2014
.gitignore
History.md
Makefile remove build from test target Dec 14, 2013
Readme.md
component.json
index.js
package.json

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