UNPKG

p-times

Version:

Run promise-returning & async functions a specific number of times concurrently

6 lines (4 loc) 174 B
import pMap from 'p-map'; export default function pTimes(count, mapper, options) { return pMap(Array.from({length: count}).fill(), (_, index) => mapper(index), options); }