An in-memory priority task queue system that organizes tasks into named groups and processes them in order. Version 2.1.0 is the latest stable release, with an irregular release cadence. It differentiates from other queues (like async.queue or bull) by its grouping mechanism, allowing developers to define an ordered list of group names, where tasks in the first group are fully drained before processing the next group. The package also supports deduplication via the 'once' option, delayed execution without auto-start, and pause/resume. It ships TypeScript type definitions and works with Node.js >=8.0.0.
npm install grouped-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue with two groups (urgent, default), adds tasks, and processes them in priority order.
Use `new Queue(['group1', 'group2'])` instead of `new Queue('group1', 'group2')`.Use `const Queue = require('grouped-queue').default` for CommonJS, or import default.Always call the `cb` parameter when using synchronous callbacks, or use async/await pattern.
Ensure you call `queue.start()` when using `runOnAdd: false`.
Listen to 'end' for each group; or implement a counter to detect when all groups finish.
Use `const Queue = require('grouped-queue').default;` or switch to ES modules.Use default import: `import Queue from 'grouped-queue'`.
Ensure you call `cb()` after completing async work: `queue.add(async (cb) => { await doWork(); cb(); })`.No dependency data recorded yet.