Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Async serial loop
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.npmignore
README.md
index.js
package.json
test.js

README.md

serial-loop

Async serial loop. See also parallel-loop

Install

$ npm install serial-loop

Usage

var loop = require('serial-loop')

loop(10, each, function (error) {
  console.log('done, error? ', error)
});

function each (next, i) {
  setTimeout(function () {
    console.log(i)
    next()
  }, 1000)
}

Will output:

0
1
2
3
3
4
5
6
7
8
9
end
Something went wrong with that request. Please try again.