Registry / testing / fetch-queue

fetch-queue

JSON →
library1.0.3jsnpmunverified

A lightweight, drop-in replacement for the native fetch API that queues HTTP requests to manage concurrency and implement automatic retries. Version 1.0.3 is the current stable release; the project appears to be in maintenance mode with no recent updates since 2021. Unlike generic queue libraries, fetch-queue is purpose-built for fetch and provides a simple API with zero dependencies, supporting custom queues with configurable concurrency, retry counts, retry delays, base URLs, and retryable HTTP status codes. It also offers debugging, queue status checks, and queue destruction. GPLv3 licensed.

npm install fetch-queue
INSTALL
IMPORT
SIG · FETCH-QUEUE
F
fetch-queue
testingjavascriptv1.0.3
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.

fetchQueue
import fetchQueue from 'fetch-queue'
const fetchQueue = require('fetch-queue')
Default import; the package does not ship TypeScript types.
debugQueue
import { debugQueue } from 'fetch-queue'
import debugQueue from 'fetch-queue/debugQueue'
Named import; no subpath exports.
createQueue
import { createQueue } from 'fetch-queue'
const createQueue = require('fetch-queue').createQueue
Named import; CommonJS require possible but discouraged.
checkQueue
import { checkQueue } from 'fetch-queue'
Named import, no known wrong pattern.
killQueue
import { killQueue } from 'fetch-queue'
Named import, no known wrong pattern.
destroyQueue
import { destroyQueue } from 'fetch-queue'
Named import, no known wrong pattern.

Shows drop-in replacement for fetch using default queue with Promise.allSettled.

import fetchQueue from 'fetch-queue' // Default queue: processes requests sequentially (concurrent: 1) with 1 retry Promise.allSettled([ fetchQueue('https://httpbin.org/post', { method: 'POST', body: JSON.stringify({ test: 1 }) }).then(resp => resp.json()), fetchQueue('https://httpbin.org/post', { method: 'POST', body: JSON.stringify({ test: 2 }) }).then(resp => resp.json()) ]).then(results => { console.log('All done', results) }).catch(err => { console.error('Queue error', err) })
Debug
Known issues
gotchaThe package does not ship TypeScript type definitions; TypeScript users must declare module types themselves.
fix
Add a declaration file (.d.ts) or use // @ts-ignore.
affects: *
gotchaThe default queue has concurrent: 1 and retries: 1; many users expect higher concurrency or no retries.
fix
Use createQueue to customize settings: createQueue('myQueue', { concurrent: 5, retries: 0 })
affects: *
gotchaThe package only works in environments where the global fetch API is available (modern browsers, Node 18+). No polyfill bundled.
fix
Ensure global fetch exists, or import a polyfill before this package.
affects: *
gotchadestroyQueue rejects with an error if queue doesn't exist; checkQueue returns undefined for non-existent queues.
fix
Use checkQueue before destroyQueue to verify existence.
affects: *
deprecatedPackage is licensed under GPLv3, which may be incompatible with proprietary or MIT-licensed projects.
fix
Consider alternative queue libraries with permissive licenses (e.g., p-limit, bottleneck).
affects: *
Errors
Common errors & fixes
fetchQueue is not a function
Using CommonJS require incorrectly: const fetchQueue = require('fetch-queue') imports an object, not the function directly. The default export is the function.
fix
Use default import: import fetchQueue from 'fetch-queue' or const { default: fetchQueue } = require('fetch-queue')
Cannot find module 'fetch-queue'
Package not installed or typo in package name.
fix
Run npm install fetch-queue and ensure the import path is correct.
fetch is not defined
Running in an environment without global fetch (e.g., Node <18 or older browser).
fix
Install a fetch polyfill like 'node-fetch' and assign to global.fetch, or upgrade your runtime.
queueName is not defined
Using fetchQueue with a third argument but the queue does not exist; createQueue must be called first.
fix
Call createQueue('myQueue', options) before using fetchQueue(url, options, 'myQueue').
Upgrade
Version history
1.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
fetch-queue — npm install fetch-queue · libregistry