Asynchronous function queue with adjustable concurrency. Version 7.0.0. Allows controlling the number of concurrently running async jobs, with support for timeouts, event listeners, and array-like API (push, unshift, splice, etc.). Jobs can use callbacks or return promises. Ships TypeScript types. Maintained actively on GitHub.
npm install queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue with concurrency 2, adds three jobs (callback and promise style), and starts processing.
Use import or upgrade to Node >=12 with type:module in package.json, or use bundler like Webpack/Rollup.
Listen to 'end' event for completion and check error parameter, or use promise returned by start().
Use q.toArray() or manually copy the array if you need an independent copy.
Either always use callback or always use .then().catch() on the returned promise.
Set timeout as a property on the job function itself.
Use only one completion mechanism per job.
Use `import Queue from 'queue'`.
Use import or compile with bundler (Webpack/Rollup).
Increase timeout or set per-job timeout via job.timeout property.
Ensure each pushed item is a function that accepts a callback or returns a promise.
No dependency data recorded yet.