1.1.0 • Published 2 years ago
@acegoal07/timestamp-progress v1.1.0
npm i @acegoal07/timestamp-progress
const progress = require('@acegoal07/timestamp-progress');
// Supported timestamp layouts 00:SS, MM:SS or HH:MM:SS
// Input
const duration = "03:20"; // 09:00:28
const position = "01:20"; // 07:00:28
// Creation
const progressBar = progress(position, duration); // Reference progressBar to display
size - The size of the progress bar ( default: 40 )
timestamp - Weather or not to display timestamp in output ( default: true )
percentage - Whether or not to disable percentage completed instead of ( default: false )
line - The character used to display remaining length ( default: □ )
slider - The character used to display the progress ( default: ■ )
How to use settings:
// Way 1
settings = {
size: 20,
timestamp: false,
percentage: true,
line: "-",
slider: "#"
}
const progressBar1 = progress(position, duration, settings);
console.log(progressBar1);
// Way 2
const progressBar = progress(position, duration, {size = 20, timestamp = false, percentage = true, line = "-", slider = "#"});
console.log(progressBar2);