# stream-reduce

> Reduce stream data to a single value

Latest version **1.0.3** (published 2014-03-07) · Public Domain license · 0 weekly downloads

## Install

```sh
npm install stream-reduce
pnpm add stream-reduce
yarn add stream-reduce
bun add stream-reduce
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2014-03-07 |
| First published | 2013-08-09 |
| Weekly downloads | 0 |
| License | Public Domain |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Parsha Pourkhomami |
| Maintainers | parshap |
| Keywords | stream, reduce |

## Links

- npm: https://www.npmjs.com/package/stream-reduce
- Repository: git@github.com:parshap/node-stream-reduce
- Homepage: https://github.com/parshap/node-stream-reduce
- Issues: https://github.com/parshap/node-stream-reduce/issues
- npm.io page: https://npm.io/package/stream-reduce

## Dependencies (1)

- [through](https://npm.io/package/through.md) ~2.3.4

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2014-03-07
- 1.0.2 — 2014-03-07
- 1.0.1 — 2013-11-19
- 1.0.0 — 2013-08-09

## README

# stream-reduce

Like [`Array.prototype.reduce`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce)
but for streams. Given a sync reduce function and an initial value it
will return a through stream that emits a single data event with the
reduced value once the input stream ends.

# Example

```js
var reduce = require("stream-reduce");

process.stdin.pipe(reduce(function(acc, data) {
	return acc + data.length;
}, 0)).on("data", function(length) {
	console.log("stdin size:", length);
});
```

# Installation

```
npm install stream-reduce
```

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