import { map } from "bluebird" ; const CONCURRENCY = 5 ; export default async function concurrentForEach < T > ( array , iterator ) { await map ( array , iterator , { concurrency : CONCURRENCY } ) ; }