JSPM

wildcards

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 376
  • Score
    100M100P100Q81274F
  • License MIT

emitter wildcard support

Package Exports

  • wildcards

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (wildcards) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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