@alphasquad/foreach-await
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Await inside forEach

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

Install

npm install [--save] @alphasquad/foreach-await

// OR

npm i [-S] @alphasquad/foreach-await

Usage

For ECMA < ES6

const forEach = require('@alphasquad/foreach-await')

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 '@alphasquad/foreach-await'

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

// To await the entire loop

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

Package Sidebar

Install

npm i @alphasquad/foreach-await

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

3 kB

Total Files

6

Last publish

Collaborators

  • assadakramiintellect
  • abasitq
  • aqkhan