simple-progress-bar

0.3.6 • Public • Published

NPM

simple-progress-bar

A console progress bar that is easy to use and understand.

Constructor:

var progressbar = new ProgressBar(labelText, formatString, writeableStream);

  1. labelText: string (Default: Progress) The value of the label next to the progress bar.

  2. formatString: string (Default: :label :bar :percent) The string containing format elements to be replaced on update.

    1. :label replaced with the labelText value.
    2. :bar replaced with the progress bar.
    3. :percent replaced with the current progress percent.
  3. writeableStream: obj (Default: stdout) The writable stream the progressbar will be written to.

Example Usage:

var ProgressBar = require('simple-progrss-bar'),
    pb;

globals.pubsub.on('event', (itemCount, totalItems) => {
    pb = pb || new ProgressBar('Progress: ', ':label \t [ :bar ] :percent ');
    pb.update(itemCount, totalItems);
});

Methods:

update(itemCount, totalItems): updates the progress bar to the percent calculated by the itemCount divided by the totalItems value.

Building:

grunt This will build the package manually.

Built with TypeScript.

Readme

Keywords

none

Package Sidebar

Install

npm i simple-progress-bar

Weekly Downloads

254

Version

0.3.6

License

none

Last publish

Collaborators

  • pwdonald