npm.io
1.0.1 • Published 3 years ago

ap-queuefy

Licence
ISC
Version
1.0.1
Deps
0
Size
2 kB
Vulns
0
Weekly
0

AP QUEUEFY

v1.0.0

aqpMap

Usage
aqpMap takes 3 parameters
- items: Array = default array of items
- concurrency: Integer = number of concurrent promises to be resolved
- callback: Function = callback function with 1 parameter that modifies one item at a time
Example
    import { apqMap } from "ap-queuefy";

    let items = [10, 20, 40, 100];
    (async () => {
        let results = await apqMap(items, 2, async function(item) {
            return item - 1;
        });

        console.log(results);
    })();

Keywords