Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
evt-emitter
Advanced tools
Node's events module with a createListener factory method on its prototype.
It creates an instance of EventListener (evt-listener) without having to pass an event emitter parameter. See below for a comparison.
Install it using npm, saving it as a dependency.
npm i evt-emitter --save
We're going to compare how events and evt-emitter do the following:
var EventEmitter = require('events').EventEmitter;
var events = new EventEmitter();
var eventName = 'eventName';
var eventNameListener = function(payload) {
console.log('Event ' + eventName + ' triggered with: ' + playload);
};
events.on(eventName, eventNameListener);
//sometime later..
events.removeListener(eventName, eventNameListener);
var EventEmitter = require('evt-emitter').EventEmitter;
var events = new EventEmitter();
var eventNamelistener = events.createListener('eventName').on(function(payload) {
console.log('Event ' + eventNameListener.event + ' triggered with: ' + playload);
});
//sometime later..
eventNameListener.off();
Check out evt-listener's documentation and tests.
FAQs
Node's events module, with an evt-listener factory bundled.
The npm package evt-emitter receives a total of 0 weekly downloads. As such, evt-emitter popularity was classified as not popular.
We found that evt-emitter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.