# stream-split

> A very efficient stream splitter (using buffer delimiters)

Latest version **1.1.0** (published 2016-10-28) · ISC license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2016-10-28 |
| First published | 2015-09-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Francois Leurent |
| Maintainers | 131 |
| Keywords | nal, h264, stream |

## Links

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

## 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.1.0 (latest) — 2016-10-28
- 1.0.0 — 2016-07-26
- 0.2.0 — 2015-09-24
- 0.1.0 — 2015-09-20

## README

# Split stream

A very efficient stream splitter (using buffer delimiters)

Generate a duplex stream (transform) that split your stream into controlled chunks

[![Build Status](https://travis-ci.org/131/stream-split.svg?branch=master)](https://travis-ci.org/131/stream-split)
[![Coverage Status](https://coveralls.io/repos/github/131/stream-split/badge.svg?branch=master)](https://coveralls.io/github/131/stream-split?branch=master)
[![Version](https://img.shields.io/npm/v/stream-split.svg)](https://www.npmjs.com/package/stream-split)


# Api
```
var Split    = require('stream-split');
var splitter = new Split(buffer_separator[, options]);


  //target will receive "buffer_separator" separated chunks
somestream.pipe(splitter).pipe(target);


var options = {
  //bufferSize  : internal buffer size (default to 1 Mb)
};

```


## Options
* bufferSize 
`stream-split` use efficiant buffer copy policy (instead of merging/concat temporary chunk).
This value is an indication on what the working page size might be.
If needed, this value WILL change according to data.


# Example
```
const Split = require('stream-split');
const splitter = new Split(new Buffer("\r\n"));


splitter.on("data", function(){
  //got chunk
});


splitter.write("ok");
splitter.write("\r\n"); //got chunk
splitter.write("ok");
```


# Tests
```
npm test
```

Run tests for mocha result & istanbul (100%) coverage

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