y-log-bar
A nodejs console progress bar for heavy scripts.
Useful to monitor long time scripts.
Install :
npm install y-log-bar
Import :
const logbar = ;
Use
The progress bar will stays at the bottom of your terminal as long as you use logbar.log instead of console.log.
logbar;logbar;// instead of : console.log('data=',data);
Show in terminal.
logbar;
Remove from terminal.
logbar;
The bar display will update every time you use logbar.show or logbar.log when visible.
Menu
Areas
- 1 : title
- 2 : time
- 3 : percent value
- 4 : percent bar
Change Values
-
// must be a stringlogbartitlevalue=' some text';
-
// must be a number between 0 and 1logbarpercvalue=07;
-
#### time. Area 2. Show elapsed time.
// default = falselogbartimevisible=true;Reset elapsed time.
logbartimestart=0;
Look and feel.
Customise logbar display. NB: All colors must be a rgb value.
-
- front colors (gradient)
logbartitlefrontfrom=25500; //from leftlogbartitlefrontto=2552550; //to right- back colors (gradient)
logbartitlebackfrom=0100200; //from leftlogbartitlebackto=050100; //to right- character for for unused space
// default = ' 'logbartitlefill="="; -
- front color
logbarpercfront=25500;- back color
logbarpercback=0200150; -
- front colors (gradient)
logbarbarfrontfrom=25500; //from leftlogbarbarfrontto=2552550; //to right- back colors (gradient)
logbarbarbackfrom=0100200; //from leftlogbarbarbackto=050100; //to right- character for filled bar
logbarbarchIn='X';- character for empty bar
logbarbarchOut='-';
See exemple exemple.js.