1.1.0 • Published 4 months ago

promise-iterators v1.1.0

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

Package provides utils for promises

npm

Install

yarn add promise-iterators

or

npm i -S promise-iterators

Methods

  • mapSeries
  • mapSeriesSafe (avoid crashing on exception)
  • eachSeries
  • eachSeriesSafe

Example

import { mapSeries } from 'promise-iterators'

const idList = [1,2,3,4,5]

const data = await mapSeries(idList, async (id, index) => {
    const result = await api.getObject(id)
    return result
})

console.log(data) // [obj1, obj2, obj3, ...]
1.1.0

4 months ago

1.0.0

8 months ago

0.0.1

8 months ago

0.0.1-rc.1

8 months ago