UNPKG

260 BJavaScriptView Raw
1
2var AsyncArray = require('async-array')
3
4new AsyncArray([1, 2, 3, 4])
5 .mapSerial(function (item, i, next) {
6 console.log('map', item, i)
7 next(null, item)
8 })
9 .forEachSerial(function (item, i, next) {
10 console.log('each', item, i)
11 next()
12 })
13 .exec()
14