array-foreach-async
v1.0.1
Published
Add forEachAsync() async/await to Array to support async functions.
Downloads
895
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();
...
});