open-index/open-npm huggingface dataset:
npm package: @qui-cli/progress
Description: @qui-cli Plugin: Progress bar for CLI app
Author: Seth Battis
Latest version: 3.0.7

# @qui-cli/progress

@qui-cli Plugin: Progress bar for CLI app

[![npm version](https://badge.fury.io/js/@qui-cli%2Fprogress.svg)](https://npmjs.com/package/@qui-cli/progress)
[![Module type: ESM](https://img.shields.io/badge/module%20type-esm-brightgreen)](https://nodejs.org/api/esm.html)

## Install

```sh
npm install @qui-cli/progress @qui-cli/core
```

If developing a reusable plugin:

```sh
npm install --save-peer  @qui-cli/progress@>=3
```

## Usage

```ts
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

```ts
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.