Socket
Socket
Sign inDemoInstall

stream-lines

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-lines - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

23

lib/line-reader.js

@@ -1,3 +0,2 @@

var util = require('util')
, Transform = require('stream').Transform
var through = require('through3')
, LF = '\n'.charCodeAt(0);

@@ -15,9 +14,3 @@

*/
function LineReader(options) {
if(!(this instanceof LineReader)) {
return new LineReader(options);
}
Transform.call(this);
this._writableState.objectMode = false;
this._readableState.objectMode = true;
function LineStream(options) {
options = options || {};

@@ -28,8 +21,6 @@ this.encoding = options.encoding || 'utf8';

util.inherits(LineReader, Transform);
/**
* Transform function.
*/
function _transform(chunk, encoding, cb) {
function transform(chunk, encoding, cb) {
var str, lines, i = chunk.length - 1, b;

@@ -73,3 +64,3 @@

function _flush() {
function flush(cb) {
var lines;

@@ -83,7 +74,5 @@ // unterminated last line, need to flush it

this.buffer = null;
cb();
}
LineReader.prototype._transform = _transform;
LineReader.prototype._flush = _flush;
module.exports = LineReader;
module.exports = through.transform(transform, flush, {ctor: LineStream});
{
"name": "stream-lines",
"description": "Line transform stream, reads bytes writes arrays of lines.",
"version": "1.0.3",
"version": "1.1.0",
"author": "muji <noop@xpm.io>",

@@ -10,3 +10,5 @@ "repository": {

},
"dependencies": {},
"dependencies": {
"through3": "~1.1.1"
},
"devDependencies": {

@@ -13,0 +15,0 @@ "chai": "~1.10.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc