{"id":46338,"library":"seq-queue","title":"seq-queue","description":"seq-queue is a FIFO task queue for Node.js that serializes asynchronous operations, ensuring tasks execute in order. Version 0.0.5 is the latest stable release; the package is in maintenance mode with no recent updates. It provides timeout handling per task and events for timeout, close, and drain. Compared to async.queue or bottleneck, seq-queue is minimal with no external dependencies and focuses solely on ordered execution with timeout support.","status":"maintenance","version":"0.0.5","language":"javascript","source_language":"en","source_url":"git@github.com:changchang/seq-queue","tags":["javascript"],"install":[{"cmd":"npm install seq-queue","lang":"bash","label":"npm"},{"cmd":"yarn add seq-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add seq-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require works but ESM import is supported since the package ships both CJS and ESM.","wrong":"const seqqueue = require('seq-queue'); const queue = seqqueue.createQueue(1000);","symbol":"createQueue","correct":"import { createQueue } from 'seq-queue'"},{"note":"Default import works in ESM; CommonJS require returns the module object directly.","wrong":"const seqqueue = require('seq-queue').default","symbol":"default","correct":"import seqqueue from 'seq-queue'"},{"note":"TypeScript users may need the type; the package does not export types.","wrong":"const SeqQueue = require('seq-queue').SeqQueue","symbol":"SeqQueue","correct":"import { SeqQueue } from 'seq-queue'"}],"quickstart":{"code":"import { createQueue } from 'seq-queue';\n\nconst queue = createQueue(2000);\n\nqueue.push(function(task) {\n  setTimeout(() => {\n    console.log('Task 1 done');\n    task.done();\n  }, 1000);\n});\n\nqueue.push(function(task) {\n  setTimeout(() => {\n    console.log('Task 2 done');\n    task.done();\n  }, 500);\n});\n\nqueue.on('timeout', (task) => {\n  console.log('Task timed out');\n});","lang":"javascript","description":"Creates a queue with 2-second timeout, pushes two tasks that execute sequentially, and listens for timeout events."},"warnings":[{"fix":"Always call task.done() in the task callback, or set a timeout on the queue or individual tasks.","message":"If task.done() is never called, the queue will block indefinitely unless a timeout is set.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Do not call task.done() after the task has timed out; handle cleanup in the task function.","message":"Calling task.done() after a timeout is ignored; the queue moves on to the next task.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use a library like async.queue or bottleneck for concurrent task processing.","message":"Queue does not support concurrency; tasks are strictly sequential.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Wrap task content in try-catch and call task.done() in the finally block or use a domain.","message":"No built-in error handling for task exceptions; uncaught errors may crash the process.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"search_vec":"'0.0.5':24 'async.queue':55 'asynchron':16 'bottleneck':57 'close':50 'compar':53 'depend':66 'drain':52 'ensur':18 'event':47 'execut':20,72 'extern':65 'fifo':9 'focus':68 'handl':43 'javascript':76 'latest':27 'mainten':34 'minim':62 'mode':35 'node.js':13 'oper':17 'order':22,71 'packag':31 'per':44 'provid':41 'queue':3,6,11,60 'recent':38 'releas':29 'seq':2,5,59 'seq-queu':1,4,58 'serial':15 'sole':69 'stabl':28 'support':75 'task':10,19,45 'timeout':42,49,74 'updat':39 'version':23","created_at":"2026-06-07T12:59:26.266360+00:00","updated_at":"2026-06-07T12:59:26.266360+00:00","problems":[{"fix":"Use const queue = require('seq-queue').createQueue(1000);","cause":"CommonJS require() returns the module directly, not a constructor. Using require('seq-queue').createQueue is correct.","error":"TypeError: queue.push is not a function"},{"fix":"Ensure you are using the latest version and importing correctly. Check that the function signature is (task) => { ... }.","cause":"The task argument passed to the callback is not a proper object, possibly due to incorrect import.","error":"Error: task.done is not a function"},{"fix":"Define task as a parameter of the callback function passed to queue.push().","cause":"Using task variable outside of the push callback.","error":"ReferenceError: task 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/changchang/seq-queue","github":"git@github.com:changchang/seq-queue","docs":null,"changelog":null,"pypi":null,"npm":"seq-queue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"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}}