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 mismatchfixUse '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.fixCall 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).fixUse '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.fixRemove 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.
fixEnsure proper instantiation: const manager = new QueueManager(options);
Error: Queue item must have a 'url' property
Enqueued request object missing required 'url' field.
fixInclude 'url' in the request object: { url: '...', method: 'GET' } Cannot find module 'api-queue-manager'
Package not installed or wrong import path.
fixRun 'npm install api-queue-manager' and ensure import path is correct.
Audit
Dependencies
No dependency data recorded yet.