Socket
Socket
Sign inDemoInstall

progress

Package Overview
Dependencies
0
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

Readme.md

22

lib/node-progress.js

@@ -69,2 +69,3 @@ /*!

this.renderThrottle = options.renderThrottle !== 0 ? (options.renderThrottle || 16) : 0;
this.lastRender = -Infinity;
this.callback = options.callback || function () {};

@@ -96,10 +97,8 @@ this.tokens = {};

// schedule render
if (!this.renderThrottleTimeout) {
this.renderThrottleTimeout = setTimeout(this.render.bind(this), this.renderThrottle);
}
// try to render
this.render();
// progress complete
if (this.curr >= this.total) {
if (this.renderThrottleTimeout) this.render();
this.render();
this.complete = true;

@@ -121,5 +120,2 @@ this.terminate();

ProgressBar.prototype.render = function (tokens) {
clearTimeout(this.renderThrottleTimeout);
this.renderThrottleTimeout = null;
if (tokens) this.tokens = tokens;

@@ -129,6 +125,14 @@

var now = Date.now();
var delta = now - this.lastRender;
if (delta < this.renderThrottle) {
return;
} else {
this.lastRender = now;
}
var ratio = this.curr / this.total;
ratio = Math.min(Math.max(ratio, 0), 1);
var percent = ratio * 100;
var percent = Math.floor(ratio * 100);
var incomplete, complete, completeLength;

@@ -135,0 +139,0 @@ var elapsed = new Date - this.start;

{
"name": "progress",
"version": "2.0.0",
"version": "2.0.1",
"description": "Flexible ascii progress bar",

@@ -17,3 +17,4 @@ "repository": {

"Jordan Scales <scalesjordan@gmail.com>",
"Andrew Rhyne <rhyneandrew@gmail.com>"
"Andrew Rhyne <rhyneandrew@gmail.com>",
"Marco Brack <PapstDonB@Googlemail.com>"
],

@@ -20,0 +21,0 @@ "dependencies": {},

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc