3.0.0 • Published 4 years ago

@kessler/async-map-limit v3.0.0

Weekly downloads
21
License
Apache-2.0
Repository
github
Last release
4 years ago

@kessler/async-map-limit

A Promise.all() based implementation for doing async map with limit on concurrency.

impl.js contains my experiments with various methods to do it.

bench compares them using two different benchmark modules

const map = require('@kessler/async-map-limit')

main()

async function main() {
    // process the array, 2 items at a time 
    const result = await map([1, 2, 3, 4, 5, 6], asyncMapper, 2)
}

function asyncMapper(value) {
    return new Promise((resolve) => {
        setImmediate(() => resolve(value))
    })
}
3.0.0

4 years ago

2.0.0

4 years ago

1.0.1

4 years ago

1.0.0

5 years ago