Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/honzabrecka/dopar

It runs many promises in parallel.
https://github.com/honzabrecka/dopar

es6 javascript parallel promise

Last synced: about 1 month ago
JSON representation

It runs many promises in parallel.

Awesome Lists containing this project

README

        

# dopar

> It runs many promises in parallel.

## Installation

```console
yarn install dopar
```

## Usage

```javascript
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.