node-async-loop
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -29,6 +29,6 @@ var asyncLoop = function (array) | ||
loopRec(array, callback, endCallback, from, to, step, object); | ||
doAsyncLoop(array, object, callback, endCallback, from, to, step); | ||
}; | ||
var loopRec = function (array, callback, endCallback, currentIndex, to, step, object) | ||
var doAsyncLoop = function (array, object, callback, endCallback, currentIndex, to, step) | ||
{ | ||
@@ -74,3 +74,3 @@ if (step > 0) | ||
loopRec(array, callback, endCallback, currentIndex + step, to, step, object); | ||
doAsyncLoop(array, object, callback, endCallback, currentIndex + step, to, step); | ||
}); | ||
@@ -77,0 +77,0 @@ }; |
{ | ||
"name": "node-async-loop", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Loop through an array to execute asynchronous actions on each element.", | ||
@@ -5,0 +5,0 @@ "main": "async-loop.js", |
# node-async-loop | ||
[![Build Status](https://travis-ci.org/nathan818fr/async-loop.svg)](https://travis-ci.org/nathan818fr/async-loop) | ||
Loop through an array to execute asynchronous actions on each element. | ||
@@ -7,2 +10,9 @@ | ||
Features: | ||
* Loop through arrays | ||
* Loop through objects | ||
* Loop in the normal direction or in the reverse direction | ||
* Error handling | ||
* A callback is called for the end of the loop | ||
## Install ## | ||
@@ -13,20 +23,22 @@ ``` | ||
## Prototype ## | ||
## Function ## | ||
```js | ||
asyncLoop(array, [from, [to]], callback, [endCallback]); | ||
var asyncLoop = require('node-async-loop'); | ||
asyncLoop(array[, from[, to]], callback[, endCallback]); | ||
``` | ||
**array:** array | ||
**array:** *array* | ||
The array to loop | ||
**from (optionnal):** integer | ||
**from (optionnal):** *integer* | ||
The starting position, including (Default: 0). | ||
**to (optionnal):** integer | ||
**to (optionnal):** *integer* | ||
The final position, including (Default: array.length - 1). | ||
**callback:** function(item, next) | ||
**callback:** *function(item, next)* | ||
@@ -39,3 +51,3 @@ The function called for every elements. | ||
**endCallback (optionnal):** function(err) | ||
**endCallback (optionnal):** *function(err)* | ||
@@ -42,0 +54,0 @@ This function is called at the end. |
17649
8
200