promise-all-limit
nodejs, limit the maximum number of concurrent tasks
npm install promise-all-limit
const promiseAllLimit = ; { const text = `job ` console return { }} { try const jobs = 'a' 'b' 'c' 'd' 'e'; const concurrency = 3; const results = await ; console catch e console; } ;
will output:
started job a
started job b
started job c
job a finished
started job d
job c finished
started job e
---> err: b reject
job d finished
job e finished
License
MIT