async-stream-emitter
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -7,2 +7,6 @@ const StreamDemux = require('stream-demux'); | ||
AsyncStreamEmitter.prototype.emit = function (eventName, data) { | ||
this._listenerDemux.write(eventName, data); | ||
}; | ||
AsyncStreamEmitter.prototype.listener = function (eventName) { | ||
@@ -16,6 +20,6 @@ return this._listenerDemux.stream(eventName); | ||
AsyncStreamEmitter.prototype.emit = function (eventName, data) { | ||
this._listenerDemux.write(eventName, data); | ||
AsyncStreamEmitter.prototype.closeAllListeners = function () { | ||
this._listenerDemux.closeAll(); | ||
}; | ||
module.exports = AsyncStreamEmitter; |
{ | ||
"name": "async-stream-emitter", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "An alternantive to EventEmitter using async iterable streams.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -33,2 +33,6 @@ const assert = require('assert'); | ||
it('should expose an emit method', async () => { | ||
assert.equal(!!streamEmitter.emit, true); | ||
}); | ||
it('should expose a listener method', async () => { | ||
@@ -42,5 +46,5 @@ assert.equal(!!streamEmitter.listener, true); | ||
it('should expose an emit method', async () => { | ||
assert.equal(!!streamEmitter.emit, true); | ||
it('should expose a closeAllListeners method', async () => { | ||
assert.equal(!!streamEmitter.closeAllListeners, true); | ||
}); | ||
}); |
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
3691
55