
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
nue is an async control-flow library suited for the node event loop.
$ npm install nue
var nue = require('nue');
var start = nue.start;
var serial = nue.serial;
var fs = require('fs');
start(serial(
function (){
this.data = [];
fs.readFile('file1', this.next);
},
function (err, data){
if (err) throw this.end(err);
this.data.push(data.length);
fs.readFile('file2', this.next);
},
function (err, data){
if (err) throw this.end(err);
this.data.push(data.length);
this.next();
},
function (err) {
if (err) throw err;
console.log(this.data);
}
));
var nue = require('nue');
var start = nue.start;
var serial = nue.serial;
var serialEach = nue.serialEach;
var fs = require('fs');
start(serialEach(
function () {
this.data = 0;
this.begin('file1', 'file2', 'file3');
},
function (name) {
var self = this;
fs.readFile(name, function (err, data) {
if (err) throw this.end(err);
self.data += data.length;
self.next(null, self.data);
});
},
function (err, data) {
if (err) throw err;
console.log(data);
}
));
var nue = require('nue');
var start = nue.start;
var serial = nue.serial;
var parallel = nue.parallel;
var fs = require('fs');
start(parallel(
function () {
this.fork('file1', 'file2');
},
[
function (name) {
var self = this;
fs.readFile(name, function (err, data) {
if (err) this.err(err);
self.join(data.length);
});
},
function (path) {
var self = this;
fs.stat(path, function (err, stats) {
if (err) this.err(err);
self.join(stats.isFile());
});
}
],
function (err, results) {
if (err) throw err;
console.log(results);
}
));
var nue = require('nue');
var start = nue.start;
var serial = nue.serial;
var parallelEach = nue.parallelEach;
var fs = require('fs');
start(parallelEach(
function () {
this.begin('file1', 'file2');
},
function (name) {
var self = this;
fs.readFile(name, function (err, data) {
if (err) this.end(err);
self.join(data.length);
});
},
function (err, results) {
if (err) throw err;
console.log(results);
}
));
FAQs
An async control-flow library suited for node.js.
The npm package nue receives a total of 1,413 weekly downloads. As such, nue popularity was classified as popular.
We found that nue 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.