ProgressUpdateOptions

ProgressUpdateOptions is the argument accepted by Progress.update(). It extends ProgressOptions with an optional message field, letting you change the displayed text, labels, and bar appearance all in a single call.

Type Definition

  • message: The new status text to display alongside the progress bar.
  • label: A ProgressLabelPair to replace the active/past label pair.
  • bar: A ProgressBarOptions object to update bar appearance mid-run.
interface ProgressUpdateOptions extends ProgressOptions {
  message?: string;
}

// Inherits from ProgressOptions:
interface ProgressOptions {
  label?: ProgressLabelPair;
  bar?: ProgressBarOptions;
}

Usage

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

const bar = new Progress("Loading", 10);

bar.start();

for (let i = 1; i <= 10; i++) {
bar.step(1, {
message: `Step ${i}`,
});
}

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!