np-queue (v2.0.0) is a lightweight Promise-based queue library for controlling task concurrency and pausing/resuming execution. It supports TypeScript types and provides an API for adding tasks, wrapping functions to limit concurrency, and queue lifecycle management. Key differentiators: minimal API surface, pause/resume functionality, and optional task keys for deduplication. Release cadence appears irregular (last release unknown). Suitable for Node.js and browser environments.
npm install np-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a queue with concurrency 2, adds three tasks, demonstrates pause/resume, and wraps a function.
Do not await add() if you want concurrent execution; chain via .then() or use Promise.all().
Provide a defined key (e.g., string or number) to enable deduplication.
If you relied on default Infinity, specify concurrency: Infinity explicitly.
Use queue.add() and track promises manually for ordered results.
Use import Queue from 'np-queue' instead.
Use const Queue = require('np-queue').default;Do not await; use .then() or add them without await.
No dependency data recorded yet.