# binary-split

> a fast newline (or any delimiter) splitter stream - like require('split') but faster

Latest version **1.0.5** (published 2018-10-23) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install binary-split
pnpm add binary-split
yarn add binary-split
bun add binary-split
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2018-10-23 |
| First published | 2013-09-07 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | separate (@types/binary-split) |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 79 |
| Author | max ogden |
| Maintainers | maxogden, mourner |

## Links

- npm: https://www.npmjs.com/package/binary-split
- Repository: https://github.com/maxogden/binary-split
- Homepage: https://github.com/maxogden/binary-split#readme
- Issues: https://github.com/maxogden/binary-split/issues
- npm.io page: https://npm.io/package/binary-split

## Dependencies (1)

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

## Recent versions

- 1.0.5 (latest) — 2018-10-23
- 1.0.4 — 2018-10-23
- 1.0.3 — 2016-08-22
- 1.0.2 — 2016-03-16
- 1.0.1 — 2016-03-15
- 1.0.0 — 2015-11-28
- 0.1.2 — 2014-02-21
- 0.1.1 — 2013-12-11
- 0.1.0 — 2013-09-13
- 0.0.1 — 2013-09-07

## README

# binary-split

Split streams of binary data. Similar to [split](http://npmjs.org/split) but for Buffers.
Whereas split is String specific, this library never converts binary data into non-binary data.

[![travis][travis-image]][travis-url]

[travis-image]: https://img.shields.io/travis/maxogden/binary-split.svg?style=flat
[travis-url]: https://travis-ci.org/maxogden/binary-split

## How fast is it?

On a SSD w/ a Haswell i5 1.3ghz CPU and 4GB RAM reading a 2.6GB, 5.2 million entry line delimited JSON file takes 15 seconds. Using `split` for the same benchmark takes 1m23s.

## Example usage

```js
const split = require('binary-split')

fs.createReadStream('log.txt')
  .pipe(split())
  .on('data', line => console.log(line))
```

## API

#### split([splitOn])

Returns a stream.
You can `.pipe` other streams to it or `.write` them yourself
(if you `.write` don't forget to `.end`).

The stream will emit a stream of binary objects representing the split data.

Pass in the optional `splitOn` argument to specify where to split the data.
The default is your current operating systems EOL sequence (via `require('os').EOL`).

For more examples of usage see `test.js`.

## Collaborators

binary-split is only possible due to the excellent work of the following collaborators:

- Max Ogden ([@maxogden](https://github.com/maxogden))
- Vladimir Agafonkin ([@mourner](https://github.com/mourner))
- Martin Raifer ([@tyrasd](https://github.com/tyrasd))
- Julian Gruber ([@juliangruber](https://github.com/juliangruber))

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