Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tail

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tail - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

2

package.json

@@ -6,3 +6,3 @@ {

"description": "tail a file in node",
"version": "0.2.0",
"version": "0.2.1",
"repository": {

@@ -9,0 +9,0 @@ "type": "git",

@@ -17,31 +17,33 @@ var Tail, environment, events, fs;

var block, stream;
block = this.queue[0];
if (block.end > block.start) {
stream = fs.createReadStream(this.filename, {
start: block.start,
end: block.end - 1,
encoding: "utf-8"
});
stream.on('error', __bind(function(error) {
console.log("Tail error:" + error);
return this.emit('error', error);
}, this));
stream.on('end', __bind(function() {
this.queue.shift();
if (this.queue.length >= 1) {
return this.internalDispatcher.emit("next");
}
}, this));
return stream.on('data', __bind(function(data) {
var chunk, parts, _i, _len, _results;
this.buffer += data;
parts = this.buffer.split(this.separator);
this.buffer = parts.pop();
_results = [];
for (_i = 0, _len = parts.length; _i < _len; _i++) {
chunk = parts[_i];
_results.push(this.emit("line", chunk));
}
return _results;
}, this));
if (this.queue.length >= 1) {
block = this.queue[0];
if (block.end > block.start) {
stream = fs.createReadStream(this.filename, {
start: block.start,
end: block.end - 1,
encoding: "utf-8"
});
stream.on('error', __bind(function(error) {
console.log("Tail error:" + error);
return this.emit('error', error);
}, this));
stream.on('end', __bind(function() {
this.queue.shift();
if (this.queue.length >= 1) {
return this.internalDispatcher.emit("next");
}
}, this));
return stream.on('data', __bind(function(data) {
var chunk, parts, _i, _len, _results;
this.buffer += data;
parts = this.buffer.split(this.separator);
this.buffer = parts.pop();
_results = [];
for (_i = 0, _len = parts.length; _i < _len; _i++) {
chunk = parts[_i];
_results.push(this.emit("line", chunk));
}
return _results;
}, this));
}
}

@@ -71,4 +73,8 @@ };

}
Tail.prototype.unwatch = function() {
fs.unwatchFile(this.filename);
return this.queue = [];
};
return Tail;
})();
exports.Tail = Tail;
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