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.
emit-mapper
Advanced tools
Re-emit events while mapping them to new names.
var src = new EventEmitter();
var dest = new EventEmitter();
var events = {
before: 'preload:before',
success: 'preload:success',
failure: 'preload:failure',
};
var cleanup = emitMapper(src, dest, events);
dest.on('preload:before', console.log);
dest.on('preload:success', console.log);
dest.on('preload:failure', console.log);
src.emit('before', 'some value');
src.emit('success', 1, 2, 3);
src.emit('failure', 'moduleName', new Error('some error'));
// No more events will be re-emitted after cleanup
cleanup();
src.emit('before', 'not re-emitted');
emitMapper(source, destination, eventMapping)
Takes a source
EventEmitter, a destination
EventEmitter, and an eventMapping
object that maps source
events to destination
events. Whenever an event from the eventMapping
object is emitted on source
, a new event will be emitted on destination
with the mapped named but containing all the same arguments.
Returns a cleanup method to remove all handlers registered for re-emitting.
This module is heavily inspired by re-emitter but the ability to map event names to new names was needed. Also, this module supports back to node 0.10 while re-emitter
only supports node LTS versions.
MIT
FAQs
Re-emit events while mapping them to new names.
The npm package emit-mapper receives a total of 2 weekly downloads. As such, emit-mapper popularity was classified as not popular.
We found that emit-mapper 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.