node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…

asyncloop

Continuation passing loop which never bloats stack

Async loop

Continuation passing loop which never bloats stack.

var loop = require('asyncloop')
 
var i = 0
 
loop(function(next) {
  if (== 1000) return
  i++
  next()
})
 
assert.equal(i, 1000)
 
var j = 0
 
loop(function(next) {
  if (== 10) return
  j++
  process.nextTick(next)
})
 
setTimeout(function() {
  assert.equal(j, 10)
}, 10)

via component

component install eldargab/asyncloop

via npm

npm install asyncloop

MIT