ProgressOptions

The ProgressOptions interface defines the configuration options for a progress bar in ts-better-console. These options allow you to customize the labels and the bar appearance including length, symbols, animation, and colors.

Type Definition

The ProgressOptions interface includes the following properties:

  • label: An optional ProgressLabelPair object that provides two labels — one shown while the progress is active and another after completion.
  • bar: An optional ProgressBarOptions object that configures the bar length, symbols, animation, and per-state colors.
interface ProgressOptions {
  label?: ProgressLabelPair;
  bar?: ProgressBarOptions;
}

Usage

You can pass ProgressOptions when creating a progress bar to customize its appearance:

import { Progress } from "ts-better-console";

const bar = new Progress("Files", 100, {
label: {
while: "Installing",
past: "Installed",
},
bar: {
length: 30,
animation: "rainbow",
color: { completed: "green" },
},
});

Want to support this project?

If you find ts-better-console useful and want to support its development, consider starring the GitHub repository or buying me a coffee! Your support helps me dedicate more time to improving the library and adding new features.

Want to contribute to this project?

Contributions are welcome! If you're interested in improving the library, fixing bugs, or adding new features, feel free to check out the GitHub repository and submit a pull request. Whether you're a seasoned developer or new to open source, your contributions can make a difference!