{"id":49330,"library":"sequential-queue","title":"sequential-queue","description":"A lightweight async task queue that enforces sequential execution, ensuring tasks complete one after another. v1.0.5 is the latest stable release; updates are infrequent since the API is minimal and stable. Compared to more complex libraries like bull or bee-queue, this is a zero-dependency solution ideal for scenarios where you simply need to serialize async operations without persistence or scheduling features. It provides a simple Queue class with enqueue, start, stop, and clear methods.","status":"active","version":"1.0.5","language":"javascript","source_language":"en","source_url":"https://github.com/deptno/sequential-queue","tags":["javascript"],"install":[{"cmd":"npm install sequential-queue","lang":"bash","label":"npm"},{"cmd":"yarn add sequential-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add sequential-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM only; named export.","wrong":"const Queue = require('sequential-queue').Queue","symbol":"Queue","correct":"import { Queue } from 'sequential-queue'"},{"note":"Task is a type helper, not a runtime export.","wrong":"import { Task } from 'sequential-queue'","symbol":"Task","correct":"import type { Task } from 'sequential-queue'"},{"note":"Default export is the Queue class itself.","wrong":"import { default as SeqQueue } from 'sequential-queue'","symbol":"default import","correct":"import SeqQueue from 'sequential-queue'"}],"quickstart":{"code":"import { Queue } from 'sequential-queue';\n\nconst q = new Queue();\n\nq.enqueue(async () => {\n  console.log('Task 1');\n  await sleep(100);\n});\nq.enqueue(async () => {\n  console.log('Task 2');\n});\n\nq.start();\n\nfunction sleep(ms: number) {\n  return new Promise(resolve => setTimeout(resolve, ms));\n}","lang":"typescript","description":"Creates a queue, adds two async tasks, and starts sequential execution."},"warnings":[{"fix":"Call queue.start() after adding all tasks.","message":"Queue does not automatically start; you must call .start() after enqueuing tasks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure running tasks handle cancellation themselves if needed.","message":"Calling .stop() will not cancel the currently running task; it only prevents the next task from starting.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap task content in try-catch or use .enqueue with a promise that never rejects.","message":"Queue does not handle errors; rejections from tasks are silently ignored.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use `import { Queue } from 'sequential-queue'` instead of default import.","message":"The default export is deprecated in favor of named export 'Queue'.","severity":"deprecated","affected_versions":">=1.0.5"}],"env_vars":null,"search_vec":"'anoth':18 'api':30 'async':6,62 'bee':44 'bee-queu':43 'bull':41 'class':74 'clear':80 'compar':35 'complet':15 'complex':38 'depend':51 'enforc':10 'enqueu':76 'ensur':13 'execut':12 'featur':68 'ideal':53 'infrequ':27 'javascript':82 'latest':22 'librari':39 'lightweight':5 'like':40 'method':81 'minim':32 'need':59 'one':16 'oper':63 'persist':65 'provid':70 'queue':3,8,45,73 'releas':24 'scenario':55 'schedul':67 'sequenti':2,11 'sequential-queu':1 'serial':61 'simpl':72 'simpli':58 'sinc':28 'solut':52 'stabl':23,34 'start':77 'stop':78 'task':7,14 'updat':25 'v1.0.5':19 'without':64 'zero':50 'zero-depend':49","created_at":"2026-06-07T17:01:12.803247+00:00","updated_at":"2026-06-07T17:01:12.803247+00:00","problems":[{"fix":"Ensure you instantiate: const q = new Queue();","cause":"Using default import as a constructor but forgetting to call new.","error":"TypeError: queue.start is not a function"},{"fix":"Use const { Queue } = require('sequential-queue');","cause":"Using CommonJS require without destructuring.","error":"ReferenceError: Queue is not defined"}],"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":"https://github.com/deptno/sequential-queue#readme","github":"https://github.com/deptno/sequential-queue","docs":null,"changelog":null,"pypi":null,"npm":"sequential-queue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"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}}