1.1.2 • Published 2 years ago

@johoehn/async-foreach v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Async forEach

Iterate through an array and await its async callbacks

$ npm i @johoehn/async-foreach

Example

You can pass an array as first and the async callback as second argument:

const asyncForEach = require('@johoehn/async-foreach');
const arrayItems = [1,2,3];

(async() => {
    
    await asyncForEach(arrayItems, async (arrayItem) => {
        //await request
        console.log(arrayItem);
    });
    
})();