Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segment-boneyard/wildcards
Wildcard event emitter matching for nodejs
https://github.com/segment-boneyard/wildcards
Last synced: about 5 hours ago
JSON representation
Wildcard event emitter matching for nodejs
- Host: GitHub
- URL: https://github.com/segment-boneyard/wildcards
- Owner: segment-boneyard
- Created: 2013-12-11T03:14:43.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-04-10T15:22:04.000Z (over 10 years ago)
- Last Synced: 2024-11-09T02:19:24.199Z (7 days ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 59
- Watchers: 40
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
Awesome Lists containing this project
README
# wildcards
Wildcard event-emitter proxy for nodejs.
## Installation
```
$ npm install wildcards
$ component install segmentio/wildcards
```## Example
```js
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