
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
The ultimate solution of writing asyncronous code in a beautiful way.
npm install rush
var rush = require('rush');
var fs = require('fs');
rush({
n: 0
data: []
})(function() {
this.n++;
fs.readFile('file1.txt', this(function(data) {
this.data.push(data);
}));
fs.readFile('file2.txt', this(function(data) {
this.data.push(data);
}));
})(function() {
this.n++;
fs.readFile('file3.txt', this(function(data) {
this.data.push(data);
}));
})(function(err) {
if (err) {
// Handle the error.
return;
}
console.log(n); // => 2
// this.data should have 3 items:
// (data of) file1, file2, file3 or file2, file1, file3.
})();
You can use multiple initializers (passing of an object to Rush), but all these objects will be used like as you passed a single merged object at the beginning of the chain.
Don't rely on such behaviour, it will be fixed later.
rush({
x: 2
})(function() {
console.log(x); // Logs 3, but not 2!
})({
x: 3
})(function() {
console.log(x); // Logs 3 as intended.
})(function(err) {
check(!err);
})();
You can use regular blocks instead of initializers, as blocks are executed strictly one after another (if there are no errors in them).
MIT
FAQs
The ultimate solution of writing asyncronous code in a beautiful way.
The npm package rush receives a total of 105 weekly downloads. As such, rush popularity was classified as not popular.
We found that rush 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.