Skip to main content
Module

x/progress/mod.ts>MultiProgressBar

ProgressBar in terminal for deno
Go to Latest
class MultiProgressBar
import { MultiProgressBar } from "https://deno.land/x/progress@v1.3.6/mod.ts";

Constructors

new
MultiProgressBar(unnamed 0?: constructorOptions)

Title, total, complete, incomplete, can also be set or changed in the render method

  • title Progress bar title, default: ''
  • width the displayed width of the progress, default: 50
  • complete completion character, default: colors.bgGreen(' '), can use any string
  • incomplete incomplete character, default: colors.bgWhite(' '), can use any string
  • clear clear the bar on completion, default: false
  • interval minimum time between updates in milliseconds, default: 16
  • display What is displayed and display order, default: ':bar :text :percent :time :completed/:total'
  • prettyTime Whether to pretty print time and eta

Properties

private
encoder: TextEncoder
private
lastRenderTime: number
private
lastStr: string
private
signalListener: () => unknown
private
start
private
readonly
ttyColumns: number
clear: boolean
complete: string
display: string
incomplete: string
interval: number
prettyTime: boolean
width: number

Methods

private
breakLine()
private
resetScreen()
private
showCursor(): void
private
stdoutWrite(msg: string)
private
write(msg: string): void
console(message: string | number): void

interrupt the progress bar and write a message above it

end(): void

end: end a progress bar. No need to call in most cases, unless you want to end before 100%

render(bars: Array<renderOptions>): void

"render" the progress bar

  • bars progress bars
    • completed completed value
    • total optional, total number of ticks to complete, default: 100
    • text optional, text displayed per ProgressBar, default: ''
    • complete - optional, completion character
    • incomplete - optional, incomplete character
    • prettyTimeOptions - prettyTime options