@qui-cli/progress
v3.0.7
Published
@qui-cli Plugin: Progress bar for CLI app
Readme
@qui-cli/progress
@qui-cli Plugin: Progress bar for CLI app
Install
npm install @qui-cli/progress @qui-cli/coreIf developing a reusable plugin:
npm install --save-peer @qui-cli/progress@>=3Usage
import { Core } from '@qui-cli/core';
import { Progress } from '@qui-cli/progress';
// load user-provided command-line arguments
await Core.run();
Progress.start({ max: 10 });
for (let i = 0; i < 10; i++) {
// do a thing
Progress.increment();
Progess.caption(`Step ${i}`);
}
Progress.stop();Configuration
Progress provides no configuration options.
Options
Progress adds no user-configurable command line options.
Initialization
Progress requires no initialization
API
import { Progress } from '@qui-cli/progress';Progress.start({value?, max}): void
Start a progress bar with max steps at value position (if undefined, value is 0).
Progress.increment(): void
Increment the progress bar one step.
Progress.caption(text): void
Update the caption on the progress bar.
Progress.stop()
Stop the progress bar.
CAUTION The progress bar must be stopped for the process to end. If it is not ended, it will run indefinitely.
