{"id":49028,"library":"queue-system","title":"Queue System","description":"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.","status":"active","version":"4.1.1","language":"javascript","source_language":"en","source_url":"git@github.com:dzek69/queue-system","tags":["javascript","typescript"],"install":[{"cmd":"npm install queue-system","lang":"bash","label":"npm"},{"cmd":"yarn add queue-system","lang":"bash","label":"yarn"},{"cmd":"pnpm add queue-system","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Used for event handling; bundled dependency but may appear in node_modules.","package":"event-emitter-ish","optional":false}],"imports":[{"note":"ESM only; default export is not available.","wrong":"const Queue = require('queue-system').Queue","symbol":"Queue","correct":"import { Queue } from 'queue-system'"},{"note":"TypeScript type for tasks; not a runtime value.","symbol":"Task","correct":"import type { Task } from 'queue-system'"},{"note":"QueueEvents is the correct event enum name.","wrong":"import { Events } from 'queue-system'","symbol":"QueueEvents","correct":"import { QueueEvents } from 'queue-system'"}],"quickstart":{"code":"import { Queue } from 'queue-system';\n\nconst queue = new Queue({ concurrency: 2 });\n\nqueue.on('taskComplete', (result) => {\n  console.log('Task completed:', result);\n});\n\nqueue.add(() => new Promise(resolve => setTimeout(() => resolve('First'), 1000)));\nqueue.add(() => new Promise(resolve => setTimeout(() => resolve('Second'), 500)));\n\nqueue.start();\n\nsetTimeout(() => {\n  queue.pause();\n  console.log('Paused');\n\n  // Insert a high-priority task at the front\n  queue.add(() => Promise.resolve('Urgent'), { priority: true });\n\n  queue.start();\n}, 200);","lang":"typescript","description":"Creates a queue with concurrency 2, adds two tasks, starts, pauses, inserts a priority task, and resumes."},"warnings":[{"fix":"Use class instantiation: const queue = new Queue(options);","message":"Version 3.0.0 changed the API: queue is no longer a function constructor; use new Queue() instead.","severity":"breaking","affected_versions":"<3.0.0 || >=3.0.0"},{"fix":"Use camelCase event names: queue.on('taskComplete', handler).","message":"Events API renamed from 'task-complete' to 'taskComplete' in v4.0.0.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use destroy({ cancelRunning: false }) to preserve old behaviour.","message":"Cancellation behaviour changed in v4.0.0: running tasks are now cancelled by default when destroy() is called.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"queue.add(task, { force: true });","message":"The option 'forceStart' is deprecated; use 'add' with { force: true } instead.","severity":"deprecated","affected_versions":">=3.5.0"},{"fix":"Set concurrency to at least 1 if you expect tasks to execute immediately.","message":"Concurrency set to 0 will block all tasks; no tasks will run until concurrency is increased.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'4.1.1':19 'api':50 'browser':14 'cancel':32 'clean':49 'concurr':22 'control':23 'current':15 'differenti':46 'event':37 'flexibl':52 'forc':30 'full':43 'fulli':39 'includ':33 'insert':26 'javascript':55 'javascript/typescript':7 'monitor':38 'node.js':12 'order':54 'pause/unpause':24 'posit':29 'power':4 'queue':1,9 'run':34 'simpl':6 'stabl':16 'start':31 'support':21,45 'system':2,10 'task':8,25,35,53 'test':41 'typescript':44,56 'unit':40 'version':17 'yet':5","created_at":"2026-06-07T16:59:40.833032+00:00","updated_at":"2026-06-07T16:59:40.833032+00:00","problems":[{"fix":"Use import { Queue } from 'queue-system' (ESM) or const { Queue } = require('queue-system') (CommonJS).","cause":"Importing incorrectly in CommonJS or using version <3.0.0 with wrong syntax.","error":"Queue is not a constructor"},{"fix":"Run npm install queue-system. For ESM, ensure import uses correct path and Node v12+.","cause":"Package not installed or module resolution misconfigured (e.g., missing .js extension in ESM).","error":"Cannot find module 'queue-system'"},{"fix":"Capture the task object: const task = queue.add(...); then call task.cancel() before it finishes.","cause":"Attempting to cancel a task that has already completed or was not returned from queue.add().","error":"task.cancel is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"git@github.com:dzek69/queue-system","github":"git@github.com:dzek69/queue-system","docs":null,"changelog":null,"pypi":null,"npm":"queue-system","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}