# line-stream

> split/binary-split but lines contain byte offset in the source stream and gives access to last line fragment

Latest version **1.0.0** (published 2015-12-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install line-stream
pnpm add line-stream
yarn add line-stream
bun add line-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.0 |
| Published | 2015-12-16 |
| First published | 2013-02-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Ryan day |
| Maintainers | soldair |
| Keywords | line, stream, string, easy |

## Links

- npm: https://www.npmjs.com/package/line-stream
- Repository: https://github.com/soldair/node-line-stream
- Homepage: https://github.com/soldair/node-line-stream#readme
- Issues: https://github.com/soldair/node-line-stream/issues
- npm.io page: https://npm.io/package/line-stream

## Dependencies (1)

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

## 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.0.0 (latest) — 2015-12-16
- 0.0.3 — 2013-06-21
- 0.0.2 — 2013-05-06
- 0.0.1 — 2013-05-06
- 0.0.0 — 2013-02-17

## README

line-stream
===========

split/binary-split but lines contain byte offset in the source stream and gives access to last line fragment

- this module leaves the delimiter on the resulting buffer.
- all values are cast to buffers and emitted as buffers.
- this module is just as fast as binary-split.


```js
var linestream = require('line-stream');
var s = linestream();

s.on('data',function(line){
  console.log('line of data ',line+'');
  console.log('i come from ',line.start,'byte offset in the file')
})

fs.createReadStream(somefile).pipe(s);

```


api
---

### var linestream = require('line-stream');
  - transform stream (through2)

### linestream(delimiter) || linestream({delimiter:os.EOL,start:0})
  - returns transform stream.
  - options
    - delimiter, defaults to os.EOL but can be anything
    - start, defaults to 0. this is an offset applied to the start property of each line's "line.start" property. just helpful.

### stream
  - **properties**
    - stream.fragment, at any time this property contains the fragment of the last incomplete line or an empty buffer.
  - **events**, 
    in addition to standard stream events this module also emits
    - fragment, 
     emits before end if there is a line fragment in the fragment property.

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