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

stream-progressbar

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-progressbar - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

11

index.js
var PassThrough = require('stream').PassThrough;
var ProgressBar = require('progress');
module.exports = function (tokens, options) {
module.exports = function(tokens, options) {
options = options || {};

@@ -10,10 +10,10 @@

pt.on('pipe', function (stream) {
pt.on('pipe', function(stream) {
if (total) {
var bar = new ProgressBar(tokens, options);
pt.on('data', function (chunk) {
pt.on('data', function(chunk) {
bar.tick(chunk.length);
});
} else {
stream.on('response', function (res) {
stream.on('response', function(res) {
var total = parseInt(res.headers['content-length'], 10);

@@ -23,3 +23,3 @@ options.total = total;

pt.on('data', function (chunk) {
pt.on('data', function(chunk) {
bar.tick(chunk.length);

@@ -33,2 +33,1 @@ });

};
{
"name": "stream-progressbar",
"version": "1.2.0",
"version": "1.3.0",
"description": "Simple progress bar for node stream",
"main": "index.js",
"files": [
"index.js"
],
"scripts": {

@@ -7,0 +10,0 @@ "test": "node test/request.js && node test/fs.js && node test/object.js"

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