Registry / devops / queue-system

queue-system

JSON →
library4.1.1jsnpmunverified

A powerful yet simple JavaScript/TypeScript tasks queue system for Node.js and browsers. Current stable version is 4.1.1. It supports concurrency control, pause/unpause, task insertion at any position, forced start, cancellation (including running tasks), and event monitoring. Fully unit tested with full TypeScript support. Differentiated by its clean API and flexible task ordering.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM only; default export is not available.

import { Queue } from 'queue-system'

TypeScript type for tasks; not a runtime value.

import type { Task } from 'queue-system'

QueueEvents is the correct event enum name.

import { QueueEvents } from 'queue-system'

Creates a queue with concurrency 2, adds two tasks, starts, pauses, inserts a priority task, and resumes.

import { Queue } from 'queue-system'; const queue = new Queue({ concurrency: 2 }); queue.on('taskComplete', (result) => { console.log('Task completed:', result); }); queue.add(() => new Promise(resolve => setTimeout(() => resolve('First'), 1000))); queue.add(() => new Promise(resolve => setTimeout(() => resolve('Second'), 500))); queue.start(); setTimeout(() => { queue.pause(); console.log('Paused'); // Insert a high-priority task at the front queue.add(() => Promise.resolve('Urgent'), { priority: true }); queue.start(); }, 200);
Debug
Known footguns
breakingVersion 3.0.0 changed the API: queue is no longer a function constructor; use new Queue() instead.
breakingEvents API renamed from 'task-complete' to 'taskComplete' in v4.0.0.
breakingCancellation behaviour changed in v4.0.0: running tasks are now cancelled by default when destroy() is called.
deprecatedThe option 'forceStart' is deprecated; use 'add' with { force: true } instead.
gotchaConcurrency set to 0 will block all tasks; no tasks will run until concurrency is increased.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources