{"id":46570,"library":"sync-queue","title":"sync-queue","description":"A simple serial task queue for Node.js that processes functions in FIFO order. Version 0.0.2 (last released in 2015, likely abandoned). Unlike promise-based queues (e.g., p-limit) or worker pools, sync-queue uses a callback-driven API where each task must explicitly call queue.next() to proceed. No dependencies, no TypeScript types, no browser support. Ideal only for minimal Node.js scripts with legacy callback patterns.","status":"abandoned","version":"0.0.2","language":"javascript","source_language":"en","source_url":"git@github.com:technicalmachine/sync-queue","tags":["javascript"],"install":[{"cmd":"npm install sync-queue","lang":"bash","label":"npm"},{"cmd":"yarn add sync-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add sync-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package exports a constructor via CommonJS; no default ESM export exists.","wrong":"import Queue from 'sync-queue'","symbol":"Queue","correct":"const Queue = require('sync-queue')"},{"note":"Queue must be called with 'new', otherwise it throws.","wrong":"const queue = Queue()","symbol":"new Queue()","correct":"const queue = new Queue()"},{"note":"place() only accepts one function; no arguments can be passed directly — use closure.","wrong":"queue.place(myFunction, args)","symbol":"queue.place()","correct":"queue.place(myFunction)"}],"quickstart":{"code":"const Queue = require('sync-queue');\nconst queue = new Queue();\n\nqueue.place(function one() {\n  console.log('Task 1 started');\n  setTimeout(() => {\n    console.log('Task 1 done');\n    queue.next();\n  }, 100);\n});\n\nqueue.place(function two() {\n  console.log('Task 2 started');\n  queue.next();\n});\n\nqueue.place(function three() {\n  console.log('All done');\n});","lang":"javascript","description":"Demonstrates serial execution: tasks run one after another, each calling next() to proceed."},"warnings":[{"fix":"Always instantiate with 'new Queue()'.","message":"Constructor throws if called without 'new'","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Ensure each task calls queue.next() exactly once.","message":"Tasks must call queue.next() to continue; forgetting leads to deadlock","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Wrap task bodies in try/catch and call queue.next() in finally or error handler.","message":"No error handling — uncaught exceptions crash the queue","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use a closure to capture arguments: queue.place(() => myFunc(arg1, arg2)).","message":"Cannot pass arguments to placed functions directly","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Consider modern alternatives: p-queue, fastq, or async.queue.","message":"No updates or maintenance since 2015","severity":"deprecated","affected_versions":"0.0.2"}],"env_vars":null,"search_vec":"'0.0.2':18 '2015':22 'abandon':24 'api':45 'base':28 'browser':61 'call':51 'callback':43,71 'callback-driven':42 'depend':56 'driven':44 'e.g':30 'explicit':50 'fifo':15 'function':13 'ideal':63 'javascript':73 'last':19 'legaci':70 'like':23 'limit':33 'minim':66 'must':49 'node.js':10,67 'order':16 'p':32 'p-limit':31 'pattern':72 'pool':36 'proceed':54 'process':12 'promis':27 'promise-bas':26 'queue':3,8,29,39 'queue.next':52 'releas':20 'script':68 'serial':6 'simpl':5 'support':62 'sync':2,38 'sync-queu':1,37 'task':7,48 'type':59 'typescript':58 'unlik':25 'use':40 'version':17 'worker':35","created_at":"2026-06-07T13:00:33.981953+00:00","updated_at":"2026-06-07T13:00:33.981953+00:00","problems":[{"fix":"Use require('sync-queue') instead of import.","cause":"ESM import used on a CJS-only package","error":"TypeError: sync_queue_1.default is not a constructor"},{"fix":"Use new Queue() to instantiate.","cause":"Called Queue() without 'new'","error":"TypeError: Queue is not a constructor"},{"fix":"Use arrow functions or bind: queue.next.bind(queue).","cause":"Lost 'this' context in setTimeout or callback","error":"Error: queue.next 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":"https://github.com/technicalmachine/sync-queue","github":"git@github.com:technicalmachine/sync-queue","docs":null,"changelog":null,"pypi":null,"npm":"sync-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}}