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

cli-progress

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cli-progress - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

3

CHANGES.md

@@ -0,1 +1,4 @@

### 1.3.0 ###
* Added: `stopOnComplete` option to automatically call `stop()` when the value reaches the total - thanks to [lennym on GitHub](https://github.com/lennym) #7
### 1.2.0 ###

@@ -2,0 +5,0 @@ * Added: `increment()` method to increase the current progress relatively - thanks to [lennym on GitHub](https://github.com/lennym) #6

@@ -6,3 +6,5 @@ var _progress = require('./main');

Example2(function(){
console.log('\nDemo finished!');
Example3(function(){
console.log('\nDemo finished!');
});
});

@@ -74,2 +76,34 @@ });

}, 50);
};
}
function Example3(onComplete){
// EXAMPLE 3 ---------------------------------------------
console.log('\nExample 3 - Stop the Bar Automatically');
// create new progress bar using default values
var b3 = new _progress.Bar({
stopOnComplete: true,
clearOnComplete: true
});
b3.start(200, 0);
// the bar value - will be linear incremented
var value = 0;
// 20ms update rate
var timer = setInterval(function(){
// increment value
value++;
// update the bar value
b3.update(value);
// set limit
if (value >= b3.getTotal()){
// stop timer
clearInterval(timer);
// run complete callback
onComplete.apply(this);
}
}, 20);
}

@@ -26,2 +26,5 @@ var _readline = require('readline');

// stop on finish ?
this.stopOnComplete = options.stopOnComplete || false;
// last drawn string - only render on change!

@@ -210,2 +213,5 @@ this.lastDrawnString = null;

}
if (this.value >= this.getTotal() && this.stopOnComplete) {
this.stop();
}
};

@@ -212,0 +218,0 @@

2

package.json
{
"name": "cli-progress",
"version": "1.2.0",
"version": "1.3.0",
"description": "Easy to use Progress-Bar for Command-Line/Terminal Applications",

@@ -5,0 +5,0 @@ "keywords": [

@@ -138,2 +138,3 @@ CLI-Progress

- `stream` (type:stream) - output stream to use (default: `process.stderr`)
- `stopOnComplete` (type:boolean) - automatically call `stop()` when the value reaches the total (default: false)
- `clearOnComplete` (type:boolean) - clear the progress bar on complete / `stop()` call (default: false)

@@ -140,0 +141,0 @@ - `barsize` (type:int) - the length of the progress bar in chars (default: 40)

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