Customize progress bar output with placeholders
masterYou can customize the format string using built-in placeholders. These can be combined in any order.
Standard Placeholders:
{bar}: The progress bar itself.{percentage}: Current progress in percent (0-100).{total}: The end value.{value}: The current value.{eta}: Expected time of accomplishment in seconds.{duration}: Elapsed time in seconds.{eta_formatted}: Expected time formatted into appropriate units.{duration_formatted}: Elapsed time formatted into appropriate units.{<payloadKeyName>}: The value of a custom token provided in thepayloadobject during.start()or.update().
const opt = {
format: 'progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}'
}
// Renders as: progress [========================================] 100% | ETA: 0s | 200/200