1.1.0 • Published 1 year ago

progbars v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Progbars

A customizable and colorful set of progressbars for Node.js CLI.

40% == ######## -------------

Installation

npm i progbars

Import

const { progressBar, countBar } = require("progbars");

ProgressBars

Bar NameBar Output
progressBar (currentTick, maxTicks, barLength) 30% == ###-------
timeBar (tickDuration, maxTicks, barLength) 30% == ###-------
countBar (currentTick, maxTicks, barLength) 3/10 == ###-------
logBar (currentTick, maxTicks, logText) 3/10 == This is a log text!

Params

ParameterTypeDescription
currentTickintcurrent tick counter. ( --> 3/10 )
maxTicksintmax ticks number. ( 3/10 <-- )
barLengthintcharacters bar length displayed on CLI.
tickDurationintmilliseconds between ticks.
logTextstringtext message to log.

Examples

var totalTasks = 10;
var barLength = 20;

for (var i = 0; i < totalTasks; i++) {
  // DO A TASK
  progressBar(i + 1, totalTasks, barLength);
}
1.1.0

1 year ago

1.0.0

1 year ago