linerstream
Advanced tools
Comparing version 0.0.6 to 0.1.0
11
index.js
var Transform = require('stream').Transform | ||
var util = require('util') | ||
function Liner() { | ||
var opts = { | ||
objectMode: true | ||
} | ||
function Liner(opts) { | ||
opts = opts || {} | ||
opts.objectMode = true | ||
Transform.call(this, opts) | ||
@@ -12,3 +11,3 @@ } | ||
util.inherits(Liner, Transform) | ||
Liner.prototype._transform = function(chunk, encoding, done) { | ||
Liner.prototype._transform = function transform(chunk, encoding, done) { | ||
var data = chunk.toString() | ||
@@ -25,3 +24,3 @@ if (this._lastLineData) { | ||
Liner.prototype_flush = function(done) { | ||
Liner.prototype_flush = function flush(done) { | ||
if (this._lastLineData) { | ||
@@ -28,0 +27,0 @@ this.push(this._lastLineData) |
{ | ||
"name": "linerstream", | ||
"version": "0.0.6", | ||
"version": "0.1.0", | ||
"description": "Split a readable stream by newline characters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -23,3 +23,6 @@ # linerstream | ||
// splitter is an instance of require('stream').Transform | ||
var splitter = new Linestream() | ||
var opts = { | ||
highWaterMark: 2 | ||
} | ||
var splitter = new Linestream(opts) // opts is optional | ||
@@ -26,0 +29,0 @@ var readStream = fs.createReadStream('/file/with/line/breaks.txt') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16053
37
65