0.0.1 • Published 2 years ago
node-emitter v0.0.1
node-emitter
A fast and small NodeJS event emitter, replacement of NodeJS default events, just plug and play.
Important
Before you get into this, there are certain limitations by using it.
There are no support for this methods
setMaxListeners
,getMaxListeners
,prependListener
,prependOnceListener
.Doesn't have
lisentersCount
to apply it, you need to dolisteners.length
return an array length.Doesn't throw anything, creating mistakes it'll return nothing any info about the event.
Installation
$ npm install --save node-emitter
Usage
const EventEmitter = require("node-emitter");
const ee = new EventEmitter();
ee.on("myEvent", () => {
console.log("You just called my event");
});
ee.emit('myEvent');
ee.removeListener("myEvent");
ee.addListener("myEvent", fun => { });
Support
0.0.1
2 years ago