Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
sister
Advanced tools
Readme
Foundation for your emitter implementation.
I have observed that there is a tendency to write your own implementation of event emitter. I have written a starter pack for those wishing to improve upon existing variations of event emitter implementation.
Please submit your implementation to the index when you are done.
Sister is 0.5kb event emitter that does three things: on
, off
and trigger
. It performs well (~18,313,548 operations/sec in browser). If you need something more advanced, consider one of the existing, mature alternatives.
Download using NPM:
npm install sister --save
Download using Bower:
bower install sister --save
In browser, use gajus.Sister
window
object.
emitter
Instance of the Sister()
object.event
Name of the event.handler
A function to execute when the event is triggered.listener
Event listener.emitter.on(event, handler)
handler
for event
.listener
.emitter.off(listener)
listener
.emitter.trigger(event, data)
event
listeners (in sequence) with the supplied argument.emitter
.var Sister = require('sister'),
emitter = Sister(),
listener;
listener = emitter.on('foo', console.log);
emitter.trigger('foo', 'bar');
emitter.off(listener);
emitter.trigger('foo', 'baz');
This example will print "bar" in the console.log
.
There are several existing alternatives that you might want to consider before starting to write your own implementation of an event emitter.
FAQs
Event manager.
The npm package sister receives a total of 282,216 weekly downloads. As such, sister popularity was classified as popular.
We found that sister 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.