Skip to main content
Module

x/dax/src/console/mod.ts>ProgressBar

Cross-platform shell tools for Deno and Node.js inspired by zx.
Very Popular
Latest
class ProgressBar
import { ProgressBar } from "https://deno.land/x/dax@0.39.2/src/console/mod.ts";

A progress bar instance created via $.progress(...).

Constructors

new
ProgressBar(onLog: (...data: any[]) => void, opts: ProgressOptions)

Methods

finish(): void

Finish showing the progress bar.

forceRender(): void

Forces a render to the console.

increment(inc?): this

Increments the position of the progress bar.

kind(kind: "raw" | "bytes"): this

Sets how to format the length values.

length(size: number | undefined): this

Sets the total length of the progress bar.

message(message: string | undefined): this

Sets the message the progress bar will display after the prefix in white.

noClear(value?): this

Whether the progress bar should output a summary when finished.

position(position: number): this

Sets the current position of the progress bar.

prefix(prefix: string | undefined): this

Sets the prefix message/word, which will be displayed in green.

with<TResult>(action: () => TResult): TResult

Does the provided action and will call .finish() when this is the last .with(...) action that runs.

with<TResult>(action: () => Promise<TResult>): Promise<TResult>