
Security News
ESLint Adds Official Support for Linting HTML
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
event-chain
Advanced tools
A simple way to chain events and control program flow asynchronously.
A simple way to chain events and control program flow asynchronously.
This is an open source project under the MIT license, see LICENSE.md for additional information.
npm install --save event-chain
var chain = require('event-chain')();
var example = chain.on(['one', 'two'], function() {
console.log('foo');
});
example.emit('one');
example.emit('two');
// foo to console.
Debugging is made possible with Debug and can be enabled by setting the
environment variable event-chain
:
env DEBUG=event-chain
/**
* Create an event-chain that will execute the callback after all the events have been emitted.
*
* @param events
* An array of events (string) that are required before invoking the callback.
* @param callback
* A callback function to be executed after all the provided events have been fired.
*
* @return
* A Chain object.
*/
chain.on(events, callback)
/**
* Emit the given event for the chain.
*
* @param event
* Emit an event that was previously registered with chain.on();
*/
foo.emit(event);
Customized options are available for the chain.
var chain = require('event-chain')(options);
The event that is fired once all user-defined events have completed, used internally. Default: '__complete'
FAQs
A simple way to chain events and control program flow asynchronously.
The npm package event-chain receives a total of 1,332 weekly downloads. As such, event-chain popularity was classified as popular.
We found that event-chain 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
ESLint now supports HTML linting with 48 new rules, expanding its language plugin system to cover more of the modern web development stack.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.