dopar

 It runs many promises in parallel.

Usage no npm install needed!

<script type="module">
  import dopar from 'https://cdn.skypack.dev/dopar';
</script>

README

dopar

 It runs many promises in parallel.

Installation

yarn install dopar

Usage

import dopar from 'dopar'

const lazyPromises = [
  () => oneSecondDelay(),
  () => oneSecondDelay(),
  () => oneSecondDelay(),
]

dopar(3, lazyPromises) // resolves after +-1 second instead of 3 seconds
dopar.forEach(3, lazyPromises) // resolves after +-1 second instead of 3 seconds

The difference between dopar and dopar.forEach is that the latter does not store any result in memory.