
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
multiple-callback-resolver
Advanced tools
Provides a function for generating callback functions and calls a provide callback once all callbacks have completed or an error after a configurable timeout.
This project contains a simple class that allows you to instantiate callback functions and then execute a final callback when all of the generated callbacks complete. This is especially useful in testing that a set of events is emitted in a test case or in fanning out a set of work and running some code after all of a set of callbacks has been invoked.
Let's say you have a class called Something and it emits 3 events when
when the run() method is processed.
var Resolver = require('multiple-callback-resolver');
var resolver = new Resolver();
resolver.resolve(function(error, results) {
// Get the data sent on the 'start' event.
results[0];
// Get the data sent on the 'in progress' event.
results[1];
// Get the data sent on the 'end' event.
results[2];
// Data sent to the callback provided to the `run()` method.
results[3];
};
var something = new Something();
something.once('start', resolver.createCallback());
something.once('in progress', resolver.createCallback());
something.once('end', resolver.createCallback());
something.run(resolver.createCallback());
Optionally, you may set a timeout:
var Resolver = require('multiple-callback-resolver');
var callbacks = Resolver.resolve(2, {timeoutMilliSeconds: 10}, function(error, results) {
console.log(error);
// `[ 'Timeout exceeded waiting for callback to be called.' ]`
};
// Here we call one of the two callbacks created, but not both.
callbacks[0]();
FAQs
Provides a function for generating callback functions and calls a provide callback once all callbacks have completed or an error after a configurable timeout.
We found that multiple-callback-resolver 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.