An open API service indexing awesome lists of open source software.

https://github.com/jdormit/async-for-each

Asynchronous array iteration
https://github.com/jdormit/async-for-each

Last synced: 12 months ago
JSON representation

Asynchronous array iteration

Awesome Lists containing this project

README

          

# async-for-each
## Asynchronous array iteration
`async-for-each` exposes a function to iterate over an array asynchronously. This is useful
for iteration that must occur in an asynchronous context, or for iterating over long arrays
without blocking the event loop.

# Installation

npm install --save async-for-each

# Usage

```javascript
const asyncForEach = require("async-for-each");

const arr = [1, 2, 3, 4, 5];
asyncForEach(arr, function(value, index, next) {
console.log("The value at %s is %s", index, value);
doSomethingAsyncWithValue(value, function() {
next();
});
}, function() {
console.log("Iteration complete!");
});
```
# API
#include "docs.md"