Have ideas to improve npm?Join in the discussion! ¬Ľ

    @kessler/async-map-limit

    3.0.0¬†‚Äʬ†Public¬†‚Äʬ†Published

    @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))
        })
    }
     

    Keywords

    Install

    npm i @kessler/async-map-limit

    DownloadsWeekly Downloads

    45

    Version

    3.0.0

    License

    Apache-2.0

    Unpacked Size

    11.1 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar