Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Split a readable stream by newline characters
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.jshintrc
.travis.yml
README.md
index.js
makefile
package.json

README.md

linerstream

Split a readable stream by newline characters

NPM

Build Status Dependency Status Code Climate

Installation

npm install -S linerstream

Usage

Create an instance of linestream and pipe a readable stream into that instance

var Linerstream = require('linerstream')
// splitter is an instance of require('stream').Transform
var opts = {
  highWaterMark: 2
}
var splitter = new Linerstream(opts) // opts is optional

var readStream = fs.createReadStream('/file/with/line/breaks.txt')
var lineByLineStream = readStream.pipe(splitter)
lineByLineStream.on('data', function(chunk) {
  console.dir(chunk)  // no line breaks here :)
})
Something went wrong with that request. Please try again.