{"id":46551,"library":"stubborn-queue","title":"Stubborn Queue","description":"A queue library for Node.js that continues processing tasks even if some fail, collecting errors for later handling rather than aborting the entire queue. Version 2.0.0 is the current stable release. Unlike typical async queues that halt on first error, this module ensures all tasks are attempted. It is inspired by d3-queue and supports concurrency control. Release cadence is low; the package is stable and simple.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/sethvincent/stubborn-queue","tags":["javascript","queue"],"install":[{"cmd":"npm install stubborn-queue","lang":"bash","label":"npm"},{"cmd":"yarn add stubborn-queue","lang":"bash","label":"yarn"},{"cmd":"pnpm add stubborn-queue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM only; no named exports.","wrong":"const queue = require('stubborn-queue').default","symbol":"default","correct":"import q from 'stubborn-queue'"},{"note":"CJS import uses module.exports directly.","wrong":"const { queue } = require('stubborn-queue')","symbol":"default (CJS)","correct":"const queue = require('stubborn-queue')"}],"quickstart":{"code":"import q from 'stubborn-queue';\nimport { readFile } from 'fs/promises';\n\nconst results = [];\nconst errors = [];\n\nq({ concurrency: 3 })\n  .add(readFile, '/path/to/file1.txt', 'utf8')\n  .add(readFile, '/path/to/file2.txt', 'utf8')\n  .add(readFile, '/path/to/file3.txt', 'utf8')\n  .on('taskEnd', (err, result) => {\n    if (err) errors.push(err);\n    else results.push(result);\n  })\n  .done((errs, res) => {\n    console.log('Errors:', errs);\n    console.log('Results:', res);\n  });","lang":"typescript","description":"Creates a stubborn queue with concurrency 3, adds three readFile tasks, collects errors, and logs results on completion."},"warnings":[{"fix":"Use an external ordering mechanism (e.g., track indices).","message":"The queue does not automatically serialize results order; results are collected in task completion order, not addition order.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Upgrade to 2.x for consistent event support.","message":"Event-based API (on) may not be available in all versions; check documentation.","severity":"deprecated","affected_versions":"<=1.x"},{"fix":"Use in Node.js only.","message":"Works only in Node.js; no browser support (fs module dependency).","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'2.0.0':28 'abort':23 'async':36 'attempt':49 'cadenc':62 'collect':16 'concurr':59 'continu':9 'control':60 'current':31 'd3':55 'd3-queue':54 'ensur':45 'entir':25 'error':17,42 'even':12 'fail':15 'first':41 'halt':39 'handl':20 'inspir':52 'javascript':71 'later':19 'librari':5 'low':64 'modul':44 'node.js':7 'packag':66 'process':10 'queue':2,4,26,37,56,72 'rather':21 'releas':33,61 'simpl':70 'stabl':32,68 'stubborn':1 'support':58 'task':11,47 'typic':35 'unlik':34 'version':27","created_at":"2026-06-07T13:00:28.764673+00:00","updated_at":"2026-06-07T13:00:28.764673+00:00","problems":[{"fix":"Use import q from 'stubborn-queue' or const queue = require('stubborn-queue').","cause":"Importing named export instead of default.","error":"TypeError: queue is not a function"},{"fix":"Create an instance: const q = queue(); then q.add(...).","cause":"Trying to call add on the factory function directly instead of on an instance.","error":"TypeError: q.add 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/sethvincent/stubborn-queue#readme","github":"https://github.com/sethvincent/stubborn-queue","docs":null,"changelog":null,"pypi":null,"npm":"stubborn-queue","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}}