Skip to main content
Module

x/progress/mod.unstable.ts>default

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

Constructors

new
default(unnamed 0?: constructorOptions)

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

Properties

private
encoder: TextEncoder
private
isCompleted: boolean
private
lastRender: number
private
lastStr: string
private
start
private
readonly
ttyColumns: number
clear: boolean
complete: string
display: string
incomplete: string
interval: number
preciseBar: string[]
title: string
optional
total: number
width: number

Methods

private
breakLine()
private
clearLine(direction?: Direction): void
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(completed: number, options?: renderOptions): void

"render" the progress bar

  • completed - Completed value
  • options - Optional parameters
    • title - Progress bar title
    • total - total number of ticks to complete
    • complete - completion character, If you want to change at a certain moment. For example, it turns red at 20%
    • incomplete - incomplete character, If you want to change at a certain moment. For example, it turns red at 20%