# @martin-kolarik/batch-queue

> Batch queue

Latest version **1.1.1** (published 2024-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @martin-kolarik/batch-queue
pnpm add @martin-kolarik/batch-queue
yarn add @martin-kolarik/batch-queue
bun add @martin-kolarik/batch-queue
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2024-12-09 |
| First published | 2019-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Martin Kolárik |
| Maintainers | martin-kolarik |

## Links

- npm: https://www.npmjs.com/package/@martin-kolarik/batch-queue
- Repository: https://github.com/MartinKolarik/batch-queue
- Homepage: https://github.com/MartinKolarik/batch-queue#readme
- Issues: https://github.com/MartinKolarik/batch-queue/issues
- npm.io page: https://npm.io/package/@martin-kolarik/batch-queue

## Recent versions

- 1.1.1 (latest) — 2024-12-09
- 1.1.0 — 2024-12-09
- 1.0.0 — 2019-04-25

## README

# batch-queue

## Installation

```
$ npm install @martin-kolarik/batch-queue
```

## Usage

```js
const BatchQueue = require('@martin-kolarik/batch-queue');

const batchQueue = new BatchQueue(async (items) => {
    // TODO: process `items` here.
}, /* list of options with their default values: */ {
    batchSize: 100, // process 100 items at once
    concurrency: 1, // run at most 1 instance of the processing function at a time
    timeout: 1000, // process the items after 1000 ms even if items.length < batchSize
});

batchQueue.push(...items);
```

Run `npm test` for examples.

## License
Copyright (c) 2019 Martin Kolárik. Released under the MIT license.

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