Registry / devops / suprqueue

suprqueue

JSON →
library1.8.0-4-deepnote-logjsnpmunverified

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).

npm install suprqueue
INSTALL
IMPORT
SIG · SUPRQUEUE
S
suprqueue
devopsjavascriptv1.8.0-4-deepnote-log
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Suprqueue
import { Suprqueue } from 'suprqueue'
import Suprqueue from 'suprqueue'
Named export, not default. TypeScript types included.
Suprqueue
const { Suprqueue } = require('suprqueue')
const Suprqueue = require('suprqueue')
CommonJS requires destructuring.
SuprqueueOptions, TaskHandler, MergeFunction, KeyFunction
import type { SuprqueueOptions, TaskHandler, MergeFunction, KeyFunction } from 'suprqueue'
import { SuprqueueOptions } from 'suprqueue'
These are type-only exports; use `import type` in TypeScript.

Creates a queue that fetches URLs sequentially with retry on failure.

import { Suprqueue } from 'suprqueue'; const queue = new Suprqueue<string, string>( async (url: string) => { const res = await fetch(url); return res.text(); }, { retryOnFailure: true, retryDelay: 1000, } ); // Push tasks and wait for results const [result1, result2] = await Promise.all([ queue.pushTask('https://api.example.com/data/1'), queue.pushTask('https://api.example.com/data/2'), ]); console.log(result1, result2);
Debug
Known issues
gotchaWhen using `require('suprqueue')`, you must destructure the named export: `const { Suprqueue } = require('suprqueue')`. Using `require('suprqueue').default` returns undefined.
fix
Use correct destructuring: `const { Suprqueue } = require('suprqueue')`
affects: >=0.0.0
gotchaThe `merge` option requires both `key` and `merge` to be defined. If only one is set, the queue may behave unexpectedly (tasks might not merge).
fix
Always provide both `key` and `merge` options together if you intend to merge tasks.
affects: >=0.0.0
gotchaWhen 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.
fix
Wrap the task in try/catch if you need to handle individual retry attempts.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Suprqueue is not a constructor
Importing as default instead of named export.
fix
Use `import { Suprqueue } from 'suprqueue'` instead of `import Suprqueue from 'suprqueue'`
Cannot find name 'Suprqueue'
Missing import or type definition not installed.
fix
Check that you have installed 'suprqueue' (npm install suprqueue) and imported correctly: `import { Suprqueue } from 'suprqueue'`
Property 'retryBeforeOtherTasks' does not exist on type 'SuprqueueOptions'
Typo in option name; correct is `retryBeforeOtherTasks` (note lowercase 'b').
fix
Use `retryBeforeOtherTasks` (camelCase) in options.
Upgrade
Version history
1.8.0-4-deepnote-loglatest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
suprqueue — npm install suprqueue · libregistry