Package Exports
- progrescii
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (progrescii) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
progrescii
NodeJS easy graphical progress bars for the terminal/console.
Getting Started
Installation
npm install progrescii
Usage
'use strict';
const Progress = require('progrescii');
// Create a instance and render the progress bar
var p = Progress.create({
size: 10,
total: 100
});
// Update the total percentage
p.update(50);
// Output Example:
// Loading ▪▪▪▪▪▫▫▫▫▫ 50% in 0.00s
Customize
'use strict';
const Progress = require('progrescii');
var p = Progress.create({
size: 20,
total: 40,
pending: '░',
complete: '█',
template: 'Downloading :b :p% in :ts'
// Template Text tokens:
//:b progress bar text
//:p percentage Number
//:t execution time
});
// Update the total percentage
p.update(20);
// Output Example:
Downloading █████░░░░░░░░░░░░░░░ 25% in 0.00s
Global Customization Customize
To use the same configuration every time we create a instance of the bar we can configure it as following:
'use strict';
const Progress = require('progrescii');
// Global configuration
Progress.config({
template: 'Retrieving Information [:b] :p% in :ts',
pending: ' ',
complete: '=',
size: 20
});
// Create and update instance
Progress
.create({
total: 11
})
.update(10);
// Output Example:
Retrieving Information [================== ] 91% in 0.51s