# async-iterable-queue

> Async Iterable Queue

Latest version **1.0.16** (published 2024-11-03) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install async-iterable-queue
pnpm add async-iterable-queue
yarn add async-iterable-queue
bun add async-iterable-queue
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.16 |
| Published | 2024-11-03 |
| First published | 2021-08-22 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.17.5 |
| Dependencies | 0 |
| Unpacked size | 18 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | kei-g |
| Maintainers | kei-g |
| Keywords | async, asynchronous, asynciterable, asynciterator, iterable, queue |

## Links

- npm: https://www.npmjs.com/package/async-iterable-queue
- Repository: https://github.com/kei-g/async-iterable-queue
- Issues: https://github.com/kei-g/async-iterable-queue/issues
- npm.io page: https://npm.io/package/async-iterable-queue

## 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.0.16 (latest) — 2024-11-03
- 1.0.15 — 2023-01-16
- 1.0.14 — 2023-01-16
- 1.0.13 — 2023-01-16
- 1.0.12 — 2023-01-14
- 1.0.11 — 2022-12-23
- 1.0.10 — 2021-12-11
- 1.0.9 — 2021-12-11
- 1.0.8 — 2021-11-07
- 1.0.7 — 2021-09-02
- 1.0.6 — 2021-08-31
- 1.0.5 — 2021-08-23
- 1.0.4 — 2021-08-23
- 1.0.3 — 2021-08-23
- 1.0.2 — 2021-08-22
- … 2 more at https://npm.io/package/async-iterable-queue/versions

## README

# async-iterable-queue [![license][license-image]][license-url] [![npm][npm-image]][npm-url]

[![dependency][depencency-image]][dependency-url] [![maintenance][maintenance-image]][npmsio-url] [![quality][quality-image]][npmsio-url]

`async-iterable-queue` - A library for 'Queue' class which implements AsyncIterable\<T\> works on [Node.js](https://nodejs.org/)

## CI Status

| Workflow Name | Status |
|:-:|:-:|
| **Build** | [![GitHub CI (Build)][github-build-image]][github-build-url] |
| **CodeQL** | [![GitHub CI (CodeQL)][github-codeql-image]][github-codeql-url] |
| **Coverage** | [![GitHub CI (Coverage)][github-coverage-image]][github-coverage-url] |
| **Example** | [![GitHub CI (Example)][github-example-image]][github-example-url] |

## Installation

```shell
npm i async-iterable-queue
```

## Usage

```typescript
import { AsyncIterableQueue } from 'async-iterable-queue'

type Foo = {
  id: number
  name: string
}

async function example1(queue: AsyncIterableQueue<Foo>): Promise<void> {
  console.debug('pushing 123')
  await queue.push({
    id: 123,
    name: 'foo',
  })
  console.debug('123 has been pushed')
  await queue.push({
    id: 456,
    name: 'bar',
  })
  console.debug('456 has been pushed')
  await queue.push({
    id: 789,
    name: 'baz',
  })
  console.debug('789 has been pushed')
  await queue.end()
  console.debug('\'end\' has been pushed')
}

async function example2(queue: AsyncIterableQueue<Foo>): Promise<void> {
  for await (const value of queue)
    console.debug(value)
  console.debug('all elements have been popped from queue')
}

async function example(): Promise<void> {
  console.debug('example for AsyncIterableQueue has begun')
  const queue = new AsyncIterableQueue<Foo>()
  await Promise.all([
    example1(queue),
    example2(queue),
  ])
  console.debug('example for AsyncIterableQueue has finished')
}

example()
```

## License

The scripts and documentation in this project are released under the [BSD-3-Clause License](https://github.com/kei-g/async-iterable-queue/blob/main/LICENSE)

## Contributions

Contributions are welcome! See [Contributor's Guide](https://github.com/kei-g/async-iterable-queue/blob/main/CONTRIBUTING.md)

### Code of Conduct

:clap: Be nice. See [our code of conduct](https://github.com/kei-g/async-iterable-queue/blob/main/CODE_OF_CONDUCT.md)

[depencency-image]:https://img.shields.io/librariesio/release/npm/async-iterable-queue?logo=nodedotjs
[dependency-url]:https://npmjs.com/package/async-iterable-queue?activeTab=dependencies
[github-build-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml/badge.svg?branch=main
[github-build-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/build.yml?query=branch%3Amain
[github-codeql-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml/badge.svg?branch=main
[github-codeql-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/codeql.yml?query=branch%3Amain
[github-coverage-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml/badge.svg?branch=main
[github-coverage-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/coverage.yml?query=branch%3Amain
[github-example-image]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml/badge.svg?branch=main
[github-example-url]:https://github.com/kei-g/async-iterable-queue/actions/workflows/example.yml?query=branch%3Amain
[license-image]:https://img.shields.io/github/license/kei-g/async-iterable-queue
[license-url]:https://opensource.org/licenses/BSD-3-Clause
[maintenance-image]:https://img.shields.io/npms-io/maintenance-score/async-iterable-queue?logo=npm
[npm-image]:https://img.shields.io/npm/v/async-iterable-queue.svg?logo=npm
[npm-url]:https://npmjs.org/package/async-iterable-queue
[npmsio-url]:https://npms.io/search?q=async-iterable-queue
[quality-image]:https://img.shields.io/npms-io/quality-score/async-iterable-queue?logo=npm

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