# backpressure-queue

> Pipe nodejs streams into an async.queue for parallelization, get backpressure when the queue is full.

Latest version **1.0.2** (published 2022-05-28) · GPL-3.0 license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-05-28 |
| First published | 2017-09-21 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.5.0 |
| Dependencies | 1 |
| Unpacked size | 85.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Robert K. Bell |
| Maintainers | rkb |

## Links

- npm: https://www.npmjs.com/package/backpressure-queue
- Repository: https://github.com/r-k-b/backpressure-queue
- Homepage: https://github.com/r-k-b/backpressure-queue#readme
- Issues: https://github.com/r-k-b/backpressure-queue/issues
- npm.io page: https://npm.io/package/backpressure-queue

## Dependencies (1)

- [async](https://npm.io/package/async.md) 3.2.3

## Recent versions

- 1.0.2 (latest) — 2022-05-28
- 1.0.1 — 2017-09-21
- 1.0.0 — 2017-09-21

## README

# backpressure-queue

![Node.js CI](https://github.com/r-k-b/backpressure-queue/workflows/Node.js%20CI/badge.svg?branch=master)

Returns a Writable ObjectMode Stream that allows a certain number of
simultaneous promises, and triggers stream backpressure when the
concurrency limit is hit.

Errors are swallowed.

The return value of doWork() is ignored, and cannot be retrieved.

Usage:

    async function foo(someItem) {
      console.log('work done on ' + someItem)
      return
    }
    
    const w = writableQueue({doWork: foo, limitConcurrent: 2})
    
    someSourceStream.pipe(w)

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