{"id":44991,"library":"fqueue","title":"fqueue","description":"In-memory function queue with error handling, retry capabilities, and throttling of simultaneous executions. Version 0.0.0 targets Node >=0.4.x and is an early, likely unstable release. It provides a FunctionQueue class inheriting from EventEmitter, with options for concurrency control (maxPending), retry attempts (maxAttempts), and attempt timeout. Compared to modern queue libraries like p-queue or bull, fqueue is minimal, has no dependencies, and offers manual done/error signaling rather than promise-based flow. Last updated in 2012, it should be considered exploratory code.","status":"active","version":"0.0.0","language":"javascript","source_language":"en","source_url":"git://github.com/oleics/node-fqueue","tags":["javascript"],"install":[{"cmd":"npm install fqueue","lang":"bash","label":"npm"},{"cmd":"yarn add fqueue","lang":"bash","label":"yarn"},{"cmd":"pnpm add fqueue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS only; no default export; use require with .FunctionQueue","wrong":"import { FunctionQueue } from 'fqueue';","symbol":"FunctionQueue","correct":"var FunctionQueue = require('fqueue').FunctionQueue;"},{"note":"No default export; require returns an object with FunctionQueue property","wrong":"import fqueue from 'fqueue';","symbol":"fqueue (default)","correct":"var fqueue = require('fqueue');"},{"note":"No TypeScript types; use any or manual type declarations","wrong":"import type { FunctionQueue } from 'fqueue';","symbol":"FunctionQueue type","correct":"const FunctionQueue: any = require('fqueue').FunctionQueue;"}],"quickstart":{"code":"var FunctionQueue = require('fqueue').FunctionQueue;\nvar queue = new FunctionQueue({ maxPending: 2, maxAttempts: 3 });\nvar count = 0;\nfunction task(cb) {\n  count++;\n  console.log('Executing task', count);\n  if (count < 3) {\n    queue.error(new Error('Simulated error'), task, []);\n  } else {\n    queue.done();\n  }\n}\nqueue.on('error', function(err) { console.error('Final error:', err); });\nqueue.on('done', function() { console.log('All done'); });\nqueue.start(task, []);","lang":"javascript","description":"Creates a FunctionQueue with concurrency and retry settings, starts a task that errors twice then succeeds, and listens for events."},"warnings":[{"fix":"Always call queue.done() after queue.error() completes.","message":"Calling .done() is required even after .error() to signal task completion; omitting it hangs the queue.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Explicitly set maxAttempts: 0 if retries are not desired.","message":"maxAttempts defaults to 3; set to 0 to disable retries, -1 for infinite retries.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Wrap async functions with manual done/error invocation.","message":"The queue does not support promises; all callbacks must be manually managed with .done() and .error().","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass an explicit scope option when creating the queue or calling start/enqueue.","message":"Scope option defaults to 'this' (the queue), which may cause unexpected behavior for standalone functions.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Create a .d.ts file or use any type.","message":"No TypeScript declarations; using in TypeScript requires manual type definitions.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'0.0.0':18 '0.4':21 '2012':81 'attempt':45,48 'base':76 'bull':60 'capabl':11 'class':34 'code':87 'compar':50 'concurr':41 'consid':85 'control':42 'depend':66 'done/error':70 'earli':26 'error':8 'eventemitt':37 'execut':16 'exploratori':86 'flow':77 'fqueue':1,61 'function':5 'functionqueu':33 'handl':9 'in-memori':2 'inherit':35 'javascript':88 'last':78 'librari':54 'like':27,55 'manual':69 'maxattempt':46 'maxpend':43 'memori':4 'minim':63 'modern':52 'node':20 'offer':68 'option':39 'p':57 'p-queue':56 'promis':75 'promise-bas':74 'provid':31 'queue':6,53,58 'rather':72 'releas':29 'retri':10,44 'signal':71 'simultan':15 'target':19 'throttl':13 'timeout':49 'unstabl':28 'updat':79 'version':17 'x':22","created_at":"2026-06-07T12:52:50.767948+00:00","updated_at":"2026-06-07T12:52:50.767948+00:00","problems":[{"fix":"Use var FunctionQueue = require('fqueue').FunctionQueue; then new FunctionQueue(options);","cause":"Required module incorrectly: got default export object instead of FunctionQueue constructor.","error":"TypeError: queue.start is not a function"},{"fix":"Ensure .done() is called exactly once per started task.","cause":"Called .done() when no task was running or after queue completed.","error":"Error: done() called without pending task"}],"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/oleics/node-fqueue","github":"git://github.com/oleics/node-fqueue","docs":null,"changelog":null,"pypi":null,"npm":"fqueue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","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}}