# @sovpro/delimited-stream

> A Transform stream emitting buffered data at each delimiter instance

Latest version **1.1.0** (published 2020-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sovpro/delimited-stream
pnpm add @sovpro/delimited-stream
yarn add @sovpro/delimited-stream
bun add @sovpro/delimited-stream
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-04-14 |
| First published | 2019-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 8 |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | sovpro |
| Maintainers | sovpro |
| Keywords | stream, delimited, delimiter, transform |

## Links

- npm: https://www.npmjs.com/package/@sovpro/delimited-stream
- Repository: https://github.com/sovpro/delimited-stream
- Homepage: https://github.com/sovpro/delimited-stream#readme
- Issues: https://github.com/sovpro/delimited-stream/issues
- npm.io page: https://npm.io/package/@sovpro/delimited-stream

## 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) — 2020-04-14
- 1.0.5 — 2020-01-11
- 1.0.4 — 2020-01-08
- 1.0.3 — 2019-12-30
- 1.0.2 — 2019-12-28
- 1.0.1 — 2019-12-17
- 1.0.0 — 2019-12-17

## README

# Delimited Stream

A Node.js Transform stream emitting buffered data at each delimiter instance.

[![Build status for Node.js 8.x and newer](https://github.com/sovpro/delimited-stream/workflows/Node.js%208.x%20and%20newer%20/badge.svg?branch=master)](https://github.com/sovpro/delimited-stream/commits/master)

## Constructor

The constructor requires a Buffer instance or string value representing the delimiter.

```js
const stream = new DelimitedStream (delimiter)
```

Buffered data is emitted without the delimiter by default. To keep the delimiter, pass a [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) value as the second parameter.

```js
// include delimiter in data
const stream = new DelimitedStream (delimiter, true)
```

## Example

Instantiate a stream with a [newline](https://en.wikipedia.org/wiki/Newline) sequence as the delimiter.

```js
const delimiter = Buffer.from ("\r\n")
const stream = new DelimitedStream (delimiter)
stream.on ('data', (data) => {
  const line = data.toString ('utf8')
  // do stuff
})
```

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