array-foreach-async

Add forEachAsync() async/await to Array to support async functions.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
array-foreach-async
311.0.15 years ago5 years agoMinified + gzip package size for array-foreach-async in KB

Readme

array-foreach-async
Add forEachAsync() async/await to Array to support async functions.

Install

npm install array-foreach-async

API

/**
 * @param {function} callback function(val, idx, obj)
 */
Array.prototype.forEachAsync(callback)

Usage

require('array-foreach-async');

await someArray.forEachAsync(async (item) => {
    ...
    await someAsyncFunction();
    ...
});

References