a for loop for async functions.
var fora = require('for-loop-async');
fora(function () {
this.i = 0;
}, function () {
return this.i < 10;
}, function () {
++this.i;
}, function (done) {
setTimeout(() => {
console.log(this.i);
done();
}, 1000);
});⬆this mimics this⬇
for (
// function () {
var i = 0;
// }, function () {
i < 10;
// }, function () {
++i
) {
console.log(i);
}npm install for-loop-async
MIT