1.0.0 • Published 4 years ago

@alphasquad/await-foreach v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Await inside forEach

A better forEach loop for your javascript applications with await capability.

Install

npm install [--save] await-foreach

// OR

npm i [-S] await-foreach

Usage

For ECMA < ES6

const forEach = require('await-foreach')

forEach(arr, async(item) => {
    await doSomething(item)
})

// To await the entire loop

await forEach(arr, async(item) => {
    await doSomething(item)
})

For ECMA > ES6

import forEach from 'await-foreach'

forEach(arr, async(item) => {
    await doSomething(item)
})

// To await the entire loop

await forEach(arr, async(item) => {
    await doSomething(item)
})
1.0.0

4 years ago