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

progress

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

progress - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

5

History.md

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

### 1.1.6 / 2014-06-16
* now prevents progress bar from exceeding TTY width by limiting its width to
the with of the TTY
### 1.1.5 / 2014-03-25

@@ -2,0 +7,0 @@

18

lib/node-progress.js

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

var percent = ratio * 100;
var complete = Math.round(this.width * ratio);
var incomplete;

@@ -118,7 +117,4 @@ var elapsed = new Date - this.start;

complete = Array(complete).join(this.chars.complete);
incomplete = Array(this.width - complete.length).join(this.chars.incomplete);
/* populate the bar template with percentages and timestamps */
var str = this.fmt
.replace(':bar', complete + incomplete)
.replace(':current', this.curr)

@@ -131,2 +127,14 @@ .replace(':total', this.total)

/* compute the available space for the bar */
var availableSpace = this.stream.columns - str.replace(':bar', '').length;
var width = Math.min(this.width, availableSpace);
/* TODO: the following assumes the user has one ':bar' token */
complete = Array(Math.round(width * ratio)).join(this.chars.complete);
incomplete = Array(width - complete.length).join(this.chars.incomplete);
/* fill in the actual progress bar */
str = str.replace(':bar', complete + incomplete);
/* replace the extra tokens */
if (tokens) for (var key in tokens) str = str.replace(':' + key, tokens[key]);

@@ -133,0 +141,0 @@

{
"name": "progress"
, "version": "1.1.5"
, "version": "1.1.6"
, "description": "Flexible ascii progress bar"

@@ -5,0 +5,0 @@ , "keywords": ["cli", "progress"]

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