glob-events
Advanced tools
Comparing version 0.1.0 to 0.2.0
# Changes | ||
## v0.2.0 | ||
- Added 'on' | ||
- Added 'removeAllListeners' | ||
## v0.1.0 | ||
- Initial release |
@@ -55,2 +55,6 @@ /* | ||
removeAllListeners: function (name) { | ||
this._store.removeAll(name); | ||
}, | ||
listeners: function (name, opts) { | ||
@@ -62,2 +66,4 @@ return this._store.iterator(name, opts).toArray(); | ||
Emitter.prototype.on = Emitter.prototype.addListener; | ||
exports.Emitter = Emitter; |
{ | ||
"name" : "glob-events", | ||
"version" : "0.1.0", | ||
"version" : "0.2.0", | ||
"description" : "Event emitter with glob support on event names", | ||
@@ -5,0 +5,0 @@ "keywords" : ["event", "emitter", "glob", "listener"], |
@@ -9,2 +9,9 @@ # glob-events.js [![Build Status](https://travis-ci.org/mantoni/glob-events.js.png?branch=master)](http://travis-ci.org/mantoni/glob-events.js) | ||
## Features | ||
- Node.js EventEmitter compatible API | ||
- Register listeners with glob event names (`*` and `**`) | ||
- Emit events with glob event names (`*` and `**`) | ||
- 100% test coverage | ||
## Install with npm | ||
@@ -29,9 +36,27 @@ | ||
- `emit(event[, ...])` | ||
- `addListener(event, fn)` | ||
- `removeListener(event, fn)` | ||
- `listeners([event][, options])` | ||
- `emit(event[, ...])`: Invokes all listeners registered for the given event | ||
with the optional arguments. Matching rules are applied on the event name as | ||
descibed in the [glob-tree match expressions][]. | ||
- `addListener(event, fn)` / `on(event, fn)`: Registers a listener for an event | ||
- `removeListener(event, fn)`: Unregisteres a listener for an event | ||
- `removeAllListeners([event])`: Unregisters all listeners, or all listeners | ||
for the given event. Matching rules are not applied. | ||
- `listeners([event][, options])`: Returns all listeners, or all listeners | ||
for the given event. Matching rules are applied on the event name as | ||
described in the [glob-tree match expressions][]. The options are passed on | ||
to the [glob-tree iterarator][]. | ||
## TODO | ||
- once(event, fn) | ||
- setMaxListeners(n) | ||
- listenerCount() | ||
- emit newListener events | ||
- emit removeListener events | ||
## License | ||
MIT | ||
[glob-tree match expressions]: https://github.com/mantoni/glob-tree.js#match-expressions | ||
[glob-tree iterator]: https://github.com/mantoni/glob-tree.js#node-api |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5478
55
61