# bulk-write-stream

> Writable stream that forwards everything in the highWaterMark buffer to a custom write function using the new writev api in streams

Latest version **2.0.1** (published 2019-11-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install bulk-write-stream
pnpm add bulk-write-stream
yarn add bulk-write-stream
bun add bulk-write-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 | 2.0.1 |
| Published | 2019-11-06 |
| First published | 2015-05-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mathias Buus |
| Maintainers | mafintosh |

## Links

- npm: https://www.npmjs.com/package/bulk-write-stream
- Repository: https://github.com/mafintosh/bulk-write-stream
- Issues: https://github.com/mafintosh/bulk-write-stream/issues
- npm.io page: https://npm.io/package/bulk-write-stream

## Dependencies (2)

- [inherits](https://npm.io/package/inherits.md) ^2.0.3
- [readable-stream](https://npm.io/package/readable-stream.md) ^3.1.1

## Recent versions

- 2.0.1 (latest) — 2019-11-06
- 2.0.0 — 2019-02-04
- 1.1.4 — 2018-03-23
- 1.1.3 — 2016-06-10
- 1.1.2 — 2016-06-10
- 1.1.1 — 2015-09-25
- 1.1.0 — 2015-09-24
- 1.0.0 — 2015-05-29

## README

# bulk-write-stream

Writable stream that forwards everything in the `highWaterMark` buffer
to a custom `write` function using the new [writev](https://nodejs.org/api/stream.html#stream_writable_writev_chunks_callback) api in streams

```
npm install bulk-write-stream
```

[![build status](http://img.shields.io/travis/mafintosh/bulk-write-stream.svg?style=flat)](http://travis-ci.org/mafintosh/bulk-write-stream)

## Usage

``` js
var bulk = require('bulk-write-stream')

var ws = bulk.obj(function (list, cb) {
  console.log('should write list of objects', list)
  cb()
})

ws.write('a')
ws.write('b')
ws.write('c')
ws.write('d')
```

## API

#### `var ws = bulk([options], write, [flush])`

Create a new binary bulk write stream. Options are forwarded to the writable stream constructor.
Write is called with `write(list, cb)` where list is everything currently buffered in the writable stream.

If you specify a flush function that will be called with `flush(cb)` before the stream emits `finish`.

#### `var ws = bulk.obj([options], write, [flush])`

A shorthand for setting `objectMode: true`

## License

MIT

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