# it-queue

> A queue implementation that can be iterated over

Latest version **1.1.4** (published 2026-07-03) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2026-07-03 |
| First published | 2025-06-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 5 |
| Unpacked size | 127.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 283 |
| Author | Alex Potsides |
| Maintainers | achingbrain |

## Links

- npm: https://www.npmjs.com/package/it-queue
- Repository: https://github.com/achingbrain/it
- Homepage: https://github.com/achingbrain/it/tree/main/packages/it-queue#readme
- Issues: https://github.com/achingbrain/it/issues
- npm.io page: https://npm.io/package/it-queue

## Dependencies (5)

- [main-event](https://npm.io/package/main-event.md) ^1.0.1
- [race-event](https://npm.io/package/race-event.md) ^1.6.1
- [abort-error](https://npm.io/package/abort-error.md) ^1.0.2
- [it-pushable](https://npm.io/package/it-pushable.md) ^3.2.3
- [race-signal](https://npm.io/package/race-signal.md) ^2.0.0

## Recent versions

- 1.1.4 (latest) — 2026-07-03
- 1.1.3 — 2026-04-10
- 1.1.2 — 2026-04-10
- 1.1.1 — 2025-12-12
- 1.1.0 — 2025-06-01
- 1.0.0 — 2025-06-01
- 0.0.0 — 2025-06-01

## README

# it-queue

[![codecov](https://img.shields.io/codecov/c/github/achingbrain/it.svg?style=flat-square)](https://codecov.io/gh/achingbrain/it)
[![CI](https://img.shields.io/github/actions/workflow/status/achingbrain/it/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml?query=branch%3Amain)

> A queue implementation that can be iterated over

# About

<!--

!IMPORTANT!

Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.

To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts

To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.

-->

Based on `p-queue` but with access to the underlying queue, aborting a task
removes it from the queue and you can iterate over the queue results.

## Example

```ts
import all from 'it-all'
import { Queue } from 'it-queue'

const queue = new Queue({
  concurrency: Infinity
})
void queue.add(async () => {
  return 'hello'
})
void queue.add(async () => {
  return 'world'
})

const results = await all(queue)
// ['hello', 'world']

// how many items are in the queue (includes running items)
console.info(queue.size)

// how many items are running
console.info(queue.running)

// how many items have not started running yet
console.info(queue.queued)
```

# Install

```console
$ npm i it-queue
```

## Browser `<script>` tag

Loading this module through a script tag will make its exports available as `ItQueue` in the global namespace.

```html
<script src="https://unpkg.com/it-queue/dist/index.min.js"></script>
```

# API Docs

- <https://achingbrain.github.io/it/modules/it-queue.html>

# License

Licensed under either of

- Apache 2.0, ([LICENSE-APACHE](https://github.com/achingbrain/it/blob/main/packages/it-queue/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](https://github.com/achingbrain/it/blob/main/packages/it-queue/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

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