Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
An event emitter with southern charm.
on
, off
, emit
, removeListener
, etc.)once
npm install hey-yall
const makeEmitter = require('hey-yall');
// Create an emitter object
const emitter = makeEmitter();
All emitter methods return the object on which they were called so that you can chain multiple method calls.
emitter.on(event, listener)
Adds an event listener to the emitter.
Arguments:
emitter.on('test', listener) // Listen for 'test' events
emitter.emit('test') // listener function invoked
emitter.once(event, listener)
Adds an event listener but immediately removes the listener the first time it is triggered.
Arguments:
emitter.once('test', listener) // Listen for one 'test' event
emitter.emit('test') // listener function invoked
emitter.emit('test'); // listener function not invoked
emitter.off(event[, listener])
Removes listeners for the given event, optionally specifying a specific listener to remove. If listener
is not passed then all listeners are removed.
Arguments:
emitter.on('test', listener1) // Listen for 'test' events
emitter.on('test', listener2) // Listen for 'test' events
emitter.emit('test') // Listener1 and Listener2 are called for 'test' events
emitter.off('test', listener1) // Remove the first listener
emitter.emit('test') // Listener2 for 'test' event is called
emitter.off('test') // Remove the remaining listener
emitter.emit('test'); // No listeners called
emitter.emit(event[, data...])
Emits an event and calls the listeners on all matching listeners. Additional data can be passed as arguments and they will be forwarded to listeners.
Arguments:
emitter.on('test', listener) // Listen for 'test' events
emitter.emit('test') // Listener invoked for 'test' events with no args
emitter.emit('test', 'blah', 'badee', 'blah') // Listener invoked for 'test' events with 3 args of 'blah', 'badee', 'blah'
FAQs
Basic event emitter
The npm package hey-yall receives a total of 0 weekly downloads. As such, hey-yall popularity was classified as not popular.
We found that hey-yall 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.