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

stream-log-stats

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-log-stats - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

2

bin/cli.js

@@ -6,2 +6,2 @@ #!/usr/bin/env node

process.stdin.pipe(statsView()).pipe(process.stdout);
process.stdin.pipe(statsView());

@@ -65,2 +65,2 @@ "use strict";

this.transferred = byteSize(this.bytes, 2);
};
};

@@ -0,3 +1,6 @@

"use strict";
var Transform = require("stream").Transform,
Clf = require("common-log-format"),
f = require("function-tools"),
util = require("util"),

@@ -7,14 +10,21 @@ view = require("./view"),

module.exports = StatsView;
var throttledRender = f.throttle(view.render, { restPeriod: 500 });
module.exports = function(options){
var clf = new Clf(options);
var statsView = new StatsView(options);
clf.pipe(statsView);
return clf;
};
function StatsView(options){
if (!(this instanceof StatsView)) return new StatsView(options);
Transform.call(this, options);
this._buffer = "";
}
util.inherits(StatsView, Transform);
var buf = "";
StatsView.prototype._transform = function(chunk, enc, done){
var input = chunk.toString();
input = buf + input;
input = this._buffer + input;
var matches = input.match(/\{.*?\}/g);

@@ -29,8 +39,8 @@ if (matches){

});
buf = input.replace(matches.join(""), "");
view.render(stats);
this._buffer = input.replace(matches.join(""), "");
throttledRender(stats);
} else {
buf = input;
this._buffer = input;
}
done();
};
{
"name": "stream-log-stats",
"author": "Lloyd Brookes <75pound@gmail.com>",
"version": "0.1.4",
"version": "0.1.5",
"description": "",

@@ -25,5 +25,7 @@ "repository": "https://github.com/75lb/stream-log-stats.git",

"byte-size": "^0.1.0",
"common-log-format": "^0.1.3",
"console-dope": "^0.3.4",
"function-tools": "^0.1.0",
"object-tools": "^1.0.3"
}
}
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