linerstream
Advanced tools
Comparing version 0.1.4 to 0.2.0
@@ -6,3 +6,10 @@ var Transform = require('stream').Transform | ||
function Liner(opts) { | ||
//set a default EOL per instance so it can change | ||
this.EOL = os.EOL | ||
opts = opts || {} | ||
//accept EOL as an option instead of forcing the OS reported EOL | ||
if(opts.EOL){ | ||
this.EOL = opts.EOL | ||
delete opts.EOL | ||
} | ||
opts.objectMode = true | ||
@@ -18,3 +25,3 @@ Transform.call(this, opts) | ||
} | ||
var lines = data.split(os.EOL) | ||
var lines = data.split(this.EOL) | ||
this._lastLineData = lines.splice(lines.length - 1, 1)[0] | ||
@@ -21,0 +28,0 @@ |
{ | ||
"name": "linerstream", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"description": "Split a readable stream by newline characters", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -36,2 +36,10 @@ # linerstream | ||
## Override EOL | ||
If you don't want to use the OS default `EOL` character, you can ovverride it when creating the stream | ||
``` | ||
var stream2 = new LinerStream({EOL: '\n'}) | ||
//force windows EOL | ||
var stream3 = new LinerStream({EOL: '\r\n'}) | ||
``` |
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
16501
74
45