Registry / devops / api-queue-manager

api-queue-manager

JSON →
library0.1.11jsnpmunverified

A lightweight JavaScript library (v0.1.11, pre-1.0 release) for queuing and executing API requests with offline support. It provides a simple API to enqueue requests, process them sequentially, and retry on failure. Designed for use in Node.js and browser environments, it integrates with Redux for state management. Unlike similar tools, it focuses on simplicity and minimal dependencies.

npm install api-queue-manager
INSTALL
IMPORT
SIG · API-QUEUE-MANAGER
A
api-queue-manager
devopsjavascriptv0.1.11
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.

QueueManager
import QueueManager from 'api-queue-manager'
const { QueueManager } = require('api-queue-manager')
Default export only. Use ESM import syntax for modern environments.
createQueue
import { createQueue } from 'api-queue-manager'
import createQueue from 'api-queue-manager'
Named export for creating a queue instance.
types
import type { QueueOptions } from 'api-queue-manager'
import { QueueOptions } from 'api-queue-manager'
TypeScript users should use 'import type' for type-only imports. Library ships TypeScript declarations.

Shows initialization, enqueuing a GET request with auth header, starting processing, and listening for completion events.

import QueueManager from 'api-queue-manager'; const manager = new QueueManager({ concurrent: 2, retry: 3, }); // Enqueue a request manager.enqueue({ url: 'https://api.example.com/data', method: 'GET', headers: { 'Authorization': `Bearer ${process.env.API_KEY ?? ''}` }, }); // Start processing manager.process(); // Listen for completion manager.on('completed', (result) => { console.log('Request completed:', result); });
Debug
Known issues
gotchaImport destination is not a function - possible default import mismatch
fix
Use 'import QueueManager from 'api-queue-manager'' instead of named import.
affects: >=0.1.0
breakingThe 'process' method must be called explicitly after enqueuing items; it does not start automatically.
fix
Call manager.process() after enqueuing items.
affects: >=0.1.0
deprecatedThe 'retry' option in constructor is deprecated in favor of 'retryCount' in v0.2.0 (future).
fix
Use 'retryCount' instead of 'retry' when upgrading to v0.2.0.
affects: >=0.1.0 <=0.1.11
gotchaEvent listeners ('completed', 'error') may be called from previous queue runs if not removed.
fix
Remove event listeners after processing by calling 'off' or using the returned unsubscribe function.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: queueManager.process is not a function
QueueManager instance created without 'new' keyword or incorrectly imported.
fix
Ensure proper instantiation: const manager = new QueueManager(options);
Error: Queue item must have a 'url' property
Enqueued request object missing required 'url' field.
fix
Include 'url' in the request object: { url: '...', method: 'GET' }
Cannot find module 'api-queue-manager'
Package not installed or wrong import path.
fix
Run 'npm install api-queue-manager' and ensure import path is correct.
Upgrade
Version history
0.1.11latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
20 hits · last 30 days
node
18
OpenAI (training)
1
Resources
api-queue-manager — npm install api-queue-manager · libregistry