Comparing version 0.1.0 to 0.1.1
@@ -6,3 +6,3 @@ { | ||
"description": "tail a file in node", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
15
tail.js
@@ -1,2 +0,2 @@ | ||
var Tail, events, fs; | ||
var Tail, environment, events, fs; | ||
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) { | ||
@@ -12,2 +12,3 @@ for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } | ||
fs = require('fs'); | ||
environment = process.env['NODE_ENV'] || 'development'; | ||
Tail = (function() { | ||
@@ -25,12 +26,16 @@ __extends(Tail, events.EventEmitter); | ||
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 (environment === 'development') { | ||
console.log("" + this.queue.length + " queue length on end of stream at " + (new Date())); | ||
} | ||
if (this.queue.length >= 1) { | ||
this.internalDispatcher.emit("next"); | ||
} | ||
return this.emit('end'); | ||
}, this)); | ||
stream.on('close', __bind(function() { | ||
this.queue.shift(); | ||
if (this.queue.length >= 1) { | ||
this.internalDispatcher("next"); | ||
} | ||
return this.emit('close'); | ||
@@ -37,0 +42,0 @@ }, this)); |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
3125
79
2