On executing the following code, only first function of the async.series executes.
var fs = require("fs");
var async = require("async");
var buffer = new Buffer(10);
var read = "";
var readByt;
async.series([
function(callback) {
console.log("console: 1");
},
function (callback){
console.log("console: 2");
}
],function(){});
The output is given below:
c:\>node fr.js
}}}c:/log.txt
File closed successfully.
If the following is edited as mentioned below:
var fs = require("fs");
var async = require("async");
var buffer = new Buffer(10);
var read = "";
var readByt;
async.series([
function(callback) {
console.log("test");
},
function (callback){
console.log("console: 1");
}
function (callback){
console.log("console: 2");
}
],function(){});
The output changes as below:
c:\>node fr.js
test
How do i get all the functions in the async.series to execute?
I think you need to invoke the callback argument supplied in the array of functions to instruct the async module to invoke the next function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With