2.0.5 • Published 8 years ago

progress-softbar v2.0.5

Weekly downloads
21
License
-
Repository
github
Last release
8 years ago

Flexible ascii progress bar with smooth progress using 9 different head characters.

Installation

$ npm install progress-softbar

Usage

Same like the original progress bar but without the options head, complete and incomplete which are now set during runtime.

First we create a ProgressBar, giving it a format string as well as the total, telling the progress bar when it will be considered complete. After that all we need to do is tick() appropriately.

var ProgressBar = require('progress-softbar');

var bar = new ProgressBar(':bar', { total: 200,width: 20 });
var timer = setInterval(function () {
  bar.tick();
  if (bar.complete) {
    console.log('\ncomplete\n');
    clearInterval(timer);
  }
}, 50);

Example

checking ▕██▏ ▏

Options

These are keys in the options object you can pass to the progress bar along with total as seen in the example above.

  • curr current completed index
  • total total number of ticks to complete
  • width the displayed width of the progress bar defaulting to total
  • stream the output stream defaulting to stderr
  • renderThrottle minimum time between updates in milliseconds defaulting to 16
  • clear option to clear the bar on completion defaulting to false
  • callback optional function to call when the progress bar completes

For more insctructions have a look on the original progress bar at https://www.npmjs.com/package/progress .

License

MIT

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago