# buffering-object-stream

> Buffer Node Object Streams

Latest version **1.0.1** (published 2015-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install buffering-object-stream
pnpm add buffering-object-stream
yarn add buffering-object-stream
bun add buffering-object-stream
```

## 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.1 |
| Published | 2015-09-02 |
| First published | 2015-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Remko Tronçon |
| Maintainers | remko |
| Keywords | streams, buffering |

## Links

- npm: https://www.npmjs.com/package/buffering-object-stream
- Repository: https://github.com/remko/buffering-object-stream
- Homepage: https://el-tramo.be/buffering-object-stream
- Issues: https://github.com/remko/buffering-object-stream/issues
- npm.io page: https://npm.io/package/buffering-object-stream

## Dependencies (1)

- [through2](https://npm.io/package/through2.md) ^2.0.0

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [jwt-simple](https://npm.io/package/jwt-simple.md) — 259.5K weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-09-02
- 1.0.0 — 2015-09-01

## README

# [buffering-object-stream: Buffer Node Object Streams](https://el-tramo.be/buffering-object-stream)

Adding a buffering input stream in your pipeline will collect a given number of objects,
and send them through as an array to the next stage. This is useful if you have a stream
source that emits objects, and you want to batch them together before sending them to a
database.


## Installation

    npm install buffering-object-stream --save

## Usage

For example:

    var through = require("through2");

    createSomeObjectStream()
      .pipe(bufferingObjectStream(4))
      .pipe(through(function (objects, enc, cb) {
        console.log("Got objects: ", objects);
        cb();
      });

If `createObjectStream` sends out 10 objects (e.g. strings), this will print
out something like:
    
    Got objects: ["object1", "object2", "object3", "object4"]
    Got objects: ["object5", "object6", "object7", "object8"]
    Got objects: ["object9", "object10"]


## API

### `bufferingObjectSream(bufferSize)`

- **`bufferSize`** - *integer*  
    The number of objects to buffer before emitting.

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