@seyioo/progressbar.js
v4.0.0
Published
An easy way to create terminal progress bar !
Downloads
2
Readme
Summary
Requirements
Installation
To install the package, execute this command in the terminal:
npm install @seyioo/progressbar.js
Usage
Create a customizable progress bar !
Quick Start
You just have to import the functions as well:
// Import the functions
const ProgressBar = require('@seyioo/progressbar.js');
Example
// Import the functions
const ProgressBar = require('@seyioo/progressbar.js');
// Init your progress bar
const bar = new ProgressBar(
3, // The number of stages.
['%', '-'] // [%%%%%%%%%%----------]
['|', '|'] // |%%%%%%%%%%----------|
);
// |--------------------|
bar.reload(); // |--------------------|
bar.next(); // |%%%%%%--------------|
bar.next(); // |%%%%%%%%%%%%%-------|
bar.next(); // |%%%%%%%%%%%%%%%%%%%%|
bar.next(); // |--------------------|
bar.previous(); // |%%%%%%%%%%%%%%%%%%%%|
bar.previous(); // |%%%%%%%%%%%%%-------|
bar.previous(); // |%%%%%%--------------|
bar.previous(); // |--------------------|
bar.previous(); // |%%%%%%%%%%%%%%%%%%%%|
bar.set(0); // |--------------------|
bar.set(4); // |%%%%%%--------------|
bar.set(7); // |%%%%%%--------------|
bar.set(-1); // |--------------------|
bar.set(-4); // |--------------------|