Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
ee-event-emitter
Advanced tools
A portable event emitter class
var EventEmitter = require('ee-event-emitter');
var eventEmitter = new EventEmitter();
// attach listener
eventEmitter.on('eventName', cb);
// attach listsner which is called once
eventEmitter.once('eventName', cb);
// remove all listeners for all events
eventEmitter.off();
// remove listeners for specific event
eventEmitter.off('eventName');
// remove a single listener
eventEmitter.off('eventName', listener);
// emit an event
eventEmitter.emit('eventName', arg, arg, ....);
// get all listeners
eventEmitter.listener();
// get lsisteners for a specific event
eventEmitter.listsner('eventName');
// event which is emitted when an event listener is added
eventEmitter.on('listener', function(eventName, listener){});
// event which is emitted when an event listener is removed
eventEmitter.on('removeListener', function(eventName, listener ){});
var Class = require('ee-class')
, EventEmitter = require('ee-event-emitter');
var Human = new Class({
ssinherits: EventEmitter
, name: ''
, age: 29
, init: function(options) {
this.name = options.name;
}
, sayHello: function(to) {
this.emit('startHello');
console.log('Hi %s, my name is %s, i'm %s years old.', to, this.name, this.age);
this.emit('endHello');
}
});
var Boy = new Class({
inherits: Human
, age: 12
});
var dylan = new Boy({
name: 'Dylan'
});
dylan.on('startHello', function() {
console.log('starting console output:');
});
dylan.on('endHello', function() {
console.log('finished console output:');
});
dylan.sayHello('michael'); // starting console output:
// Hi my name is Dylan and i'm 12 years old.
// finished console output!
FAQs
A portable event emitter class
The npm package ee-event-emitter receives a total of 32 weekly downloads. As such, ee-event-emitter popularity was classified as not popular.
We found that ee-event-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
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.