Promise queue with concurrency control, forked from p-queue to provide CommonJS support. Current stable version: 7.3.4 (latest). Release cadence: maintenance mode, no planned feature development. Key differentiators: maintains CommonJS compatibility for older Node.js projects, offers priority queuing, timeout, interval-based rate limiting, and supports AbortSignal. Compared to p-queue, this fork focuses on CJS users. Does not natively support ESM despite claiming to be ESM-only in v7; the package ships TypeScript types. Primarily used for rate-limiting async operations like API calls.
npm install p-queue-cjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue with concurrency 1, adds two async fetch tasks, and logs results sequentially.
Use dynamic import() in CommonJS: const PQueue = (await import('p-queue-cjs')).default; or downgrade to v6 (npm install p-queue-cjs@6).Consider migrating to p-queue (ESM) or other alternatives if new features are needed.
Change to ESM (type: module) or use dynamic import().
Use queue.add(fn, { signal: abortSignal }) instead of queue.add(fn, abortSignal).Use import type { QueueAddOptions } from 'p-queue-cjs' for type-only import.Use { queue: MyCustomQueue } instead of { queueClass: MyCustomQueue }.Use dynamic import: const PQueue = (await import('p-queue-cjs')).default;Use import PQueue from 'p-queue-cjs'.
Add 'type': 'module' to package.json or use a bundler/transpiler.