stream-lines
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -18,2 +18,5 @@ var through = require('through3') | ||
this.eol = /\r?\n/; | ||
if(options.buffer) { | ||
this.body = []; | ||
} | ||
} | ||
@@ -58,3 +61,7 @@ | ||
lines = str.split(this.eol); | ||
this.push(lines); | ||
if(this.body) { | ||
this.body = this.body.concat(lines); | ||
}else{ | ||
this.push(lines); | ||
} | ||
this.emit('lines', lines); | ||
@@ -69,5 +76,14 @@ cb(); | ||
lines = [this.buffer.toString(this.encoding)]; | ||
this.push(lines); | ||
if(this.body) { | ||
this.body = this.body.concat(lines); | ||
}else{ | ||
this.push(lines); | ||
} | ||
this.emit('lines', lines); | ||
} | ||
// buffered array of all lines | ||
if(this.body) { | ||
this.push(this.body); | ||
this.body = null; | ||
} | ||
this.buffer = null; | ||
@@ -74,0 +90,0 @@ cb(); |
{ | ||
"name": "stream-lines", | ||
"description": "Line transform stream, reads bytes writes arrays of lines.", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"author": "muji <noop@xpm.io>", | ||
@@ -6,0 +6,0 @@ "repository": { |
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
5519
83