Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Wildcard event emitter matching for nodejs
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
test
.gitignore
History.md
Makefile
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

Something went wrong with that request. Please try again.