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

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

Named export, not default. TypeScript types included.

import { Suprqueue } from 'suprqueue'

CommonJS requires destructuring.

const { Suprqueue } = require('suprqueue')

These are type-only exports; use `import type` in TypeScript.

import type { SuprqueueOptions, TaskHandler, MergeFunction, KeyFunction } from 'suprqueue'

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 footguns
gotchaWhen using `require('suprqueue')`, you must destructure the named export: `const { Suprqueue } = require('suprqueue')`. Using `require('suprqueue').default` returns undefined.
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).
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.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
4 hits · last 30 days
ahrefsbot
1
Resources