# queue-cb

> A scalable queue for parallel callbacks

Latest version **1.6.8** (published 2026-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install queue-cb
pnpm add queue-cb
yarn add queue-cb
bun add queue-cb
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.6.8 |
| Published | 2026-09-12 |
| First published | 2019-02-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=0.8 |
| Dependencies | 0 |
| Unpacked size | 26.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kevin Malakoff |
| Maintainers | kmalakoff |
| Keywords | queue, parallel, callback, concurrent |

## Links

- npm: https://www.npmjs.com/package/queue-cb
- Repository: https://github.com/kmalakoff/queue-cb
- Issues: https://github.com/kmalakoff/queue-cb/issues
- npm.io page: https://npm.io/package/queue-cb

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 1.6.8 (latest) — 2026-09-12
- 1.6.7 — 2026-08-24
- 1.6.6 — 2026-05-26
- 1.6.5 — 2026-05-26
- 1.6.4 — 2026-05-26
- 1.6.3 — 2025-12-12
- 1.6.2 — 2025-12-12
- 1.6.1 — 2025-12-04
- 1.6.0 — 2025-12-04
- 1.5.11 — 2025-12-04
- 1.5.10 — 2025-12-04
- 1.5.9 — 2025-12-03
- 1.5.8 — 2025-11-06
- 1.5.7 — 2025-10-21
- 1.5.6 — 2025-10-21
- … 36 more at https://npm.io/package/queue-cb/versions

## README

## queue-cb

A scalable queue for parallel callbacks.

The API is similar to https://github.com/d3/d3-queue, but without accumulating results in memory.

```bash
npm install queue-cb
```

```js
var Queue = require('queue-cb');

function delayedHello(callback) {
  setTimeout(function() {
    console.log("Hello!");
    callback(null);
  }, 250);
}

var q = new Queue(2); // at most two tasks run at once
q.defer(delayedHello);
q.defer(delayedHello);
q.await(function(error) {
  if (error) throw error;
  console.log("Goodbye!");
});
```

`new Queue()` allows unlimited concurrent tasks. Pass a positive limit to bound concurrency. Call `await` once after adding tasks. The completion callback receives the first task error; queued tasks stop starting, but tasks already running are not cancelled.

The package supports Node >=0.8 and both CommonJS and ES module imports. See the [API docs](https://kmalakoff.github.io/queue-cb/) for the full method signatures. The package is MIT licensed; report issues in the [GitHub repository](https://github.com/kmalakoff/queue-cb/issues).

### Documentation

[API Docs](https://kmalakoff.github.io/queue-cb/)

---
_Source: https://npm.io/package/queue-cb · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
