{"id":46560,"library":"suprqueue","title":"suprqueue","description":"Simple in-memory promise-based task queue for Node.js and browser with support for pausing, merging tasks, or retrying failed tasks. Current stable version is 1.8.0, released as needed. Key differentiators: lightweight, no external dependencies, supports task merging via key function, precheck step before each task, and fine-grained retry control (delay, ordering).","status":"active","version":"1.8.0-4-deepnote-log","language":"javascript","source_language":"en","source_url":"https://github.com/jankuca/suprqueue","tags":["javascript","queue","tasks","jobs","retry","typescript"],"install":[{"cmd":"npm install suprqueue","lang":"bash","label":"npm"},{"cmd":"yarn add suprqueue","lang":"bash","label":"yarn"},{"cmd":"pnpm add suprqueue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Named export, not default. TypeScript types included.","wrong":"import Suprqueue from 'suprqueue'","symbol":"Suprqueue","correct":"import { Suprqueue } from 'suprqueue'"},{"note":"CommonJS requires destructuring.","wrong":"const Suprqueue = require('suprqueue')","symbol":"Suprqueue","correct":"const { Suprqueue } = require('suprqueue')"},{"note":"These are type-only exports; use `import type` in TypeScript.","wrong":"import { SuprqueueOptions } from 'suprqueue'","symbol":"SuprqueueOptions, TaskHandler, MergeFunction, KeyFunction","correct":"import type { SuprqueueOptions, TaskHandler, MergeFunction, KeyFunction } from 'suprqueue'"}],"quickstart":{"code":"import { Suprqueue } from 'suprqueue';\n\nconst queue = new Suprqueue<string, string>(\n  async (url: string) => {\n    const res = await fetch(url);\n    return res.text();\n  },\n  {\n    retryOnFailure: true,\n    retryDelay: 1000,\n  }\n);\n\n// Push tasks and wait for results\nconst [result1, result2] = await Promise.all([\n  queue.pushTask('https://api.example.com/data/1'),\n  queue.pushTask('https://api.example.com/data/2'),\n]);\n\nconsole.log(result1, result2);","lang":"typescript","description":"Creates a queue that fetches URLs sequentially with retry on failure."},"warnings":[{"fix":"Use correct destructuring: `const { Suprqueue } = require('suprqueue')`","message":"When using `require('suprqueue')`, you must destructure the named export: `const { Suprqueue } = require('suprqueue')`. Using `require('suprqueue').default` returns undefined.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Always provide both `key` and `merge` options together if you intend to merge tasks.","message":"The `merge` option requires both `key` and `merge` to be defined. If only one is set, the queue may behave unexpectedly (tasks might not merge).","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Wrap the task in try/catch if you need to handle individual retry attempts.","message":"When using `retryOnFailure: true`, if the task function throws, the promise returned by `pushTask` will reject only after all retry attempts are exhausted. Intermediate errors are not exposed.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.8.0':29 'base':8 'browser':14 'control':55 'current':25 'delay':56 'depend':38 'differenti':34 'extern':37 'fail':23 'fine':52 'fine-grain':51 'function':44 'grain':53 'in-memori':3 'javascript':58 'job':61 'key':33,43 'lightweight':35 'memori':5 'merg':19,41 'need':32 'node.js':12 'order':57 'paus':18 'precheck':45 'promis':7 'promise-bas':6 'queue':10,59 'releas':30 'retri':22,54,62 'simpl':2 'stabl':26 'step':46 'support':16,39 'suprqueu':1 'task':9,20,24,40,49,60 'typescript':63 'version':27 'via':42","created_at":"2026-06-07T13:00:31.518548+00:00","updated_at":"2026-06-07T13:00:31.518548+00:00","problems":[{"fix":"Use `import { Suprqueue } from 'suprqueue'` instead of `import Suprqueue from 'suprqueue'`","cause":"Importing as default instead of named export.","error":"TypeError: Suprqueue is not a constructor"},{"fix":"Check that you have installed 'suprqueue' (npm install suprqueue) and imported correctly: `import { Suprqueue } from 'suprqueue'`","cause":"Missing import or type definition not installed.","error":"Cannot find name 'Suprqueue'"},{"fix":"Use `retryBeforeOtherTasks` (camelCase) in options.","cause":"Typo in option name; correct is `retryBeforeOtherTasks` (note lowercase 'b').","error":"Property 'retryBeforeOtherTasks' does not exist on type 'SuprqueueOptions'"}],"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/jankuca/suprqueue#readme","github":"https://github.com/jankuca/suprqueue","docs":null,"changelog":null,"pypi":null,"npm":"suprqueue","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}}