- Progress :
Progress
Progress bar class for command line interfaces.
- Spinner :
Spinner
Represents a spinner for command line interfaces.
- spinner
A singleton instance of the Spinner class. Useful for quick access when only one spinner is needed.
Progress : Progress
Progress bar class for command line interfaces.
Kind: global class
- Progress :
Progress
- new Progress(opts)
- instance
- static
- .Progress ⇒
Progress
- .cliProgress ⇒
cliProgress
- .Progress ⇒
Creates a new Progress instance.
Param | Type | Default | Description |
---|---|---|---|
opts | Object |
The options for the progress bar. | |
[opts.etaBuffer] | number |
2 |
The buffer for ETA calculation. |
[opts.clearOnComplete] | boolean |
false |
Whether to clear the progress bar on completion. |
[opts.preset] | string |
"'shades_classic'" |
The preset style for the progress bar. |
[opts.total] | number |
100 |
The total value of the progress bar. |
Gets the total value of the progress bar.
Kind: instance property of Progress
Returns: number
- The total value.
Sets the total value of the progress bar.
Kind: instance property of Progress
Param | Type | Description |
---|---|---|
total | number |
The total value to be set. |
Starts the progress bar.
Kind: instance method of Progress
Param | Type | Default | Description |
---|---|---|---|
[start] | number |
0 |
The initial value from which to start. |
Increments the current value of the progress bar.
Kind: instance method of Progress
Param | Type | Description |
---|---|---|
delta | number |
The value by which to increment. |
[payload] | Object |
Additional payload information. |
Updates the current value of the progress bar.
Kind: instance method of Progress
Param | Type | Description |
---|---|---|
value | number |
The value to which the progress bar will be updated. |
[payload] | Object |
Additional payload information. |
Updates the estimated time of arrival (ETA).
Kind: instance method of Progress
Sets the total value of the progress bar.
Kind: instance method of Progress
Param | Type | Description |
---|---|---|
totalValue | number |
The total value to be set. |
Stops the progress bar and updates it to its total value.
Kind: instance method of Progress
Progress.Progress ⇒ Progress
Static getter for the Progress class itself. This can be useful when you need a reference to the class from a static method.
Kind: static property of Progress
Returns: Progress
- The Progress class.
Static getter for the cli-progress library. This allows access to the cli-progress library from the Progress class without needing to import it separately.
Kind: static property of Progress
Returns: cliProgress
- The cli-progress library.
Spinner : Spinner
Represents a spinner for command line interfaces.
Kind: global class
- Spinner :
Spinner
- new Spinner([opts])
- instance
- static
Creates an instance of Spinner.
Param | Type | Default | Description |
---|---|---|---|
[opts] | Object |
{} |
The options for the spinner. |
[opts.id] | string |
"'spinner'" |
The unique identifier for the spinner. |
[opts.color] | string |
"'green'" |
The color of the spinner. |
[opts.succeedColor] | string |
The color when spinner succeeds. Defaults to opts.color . |
|
[opts.failColor] | string |
"'redBright'" |
The color when spinner fails. |
[opts.spinner] | string |
"'aesthetic'" |
The spinner style. |
Sets the text of the spinner.
Kind: instance property of Spinner
Param | Type | Description |
---|---|---|
text | string |
The new text to display. |
Starts the spinner with provided text and color.
Kind: instance method of Spinner
Param | Type | Description |
---|---|---|
text | string |
The text to display alongside the spinner. |
[color] | string |
The color of the spinner. Defaults to the spinner's color. |
Updates the spinner's text and color.
Kind: instance method of Spinner
Param | Type | Description |
---|---|---|
text | string |
The new text to display. |
[color] | string |
The new color of the spinner. Defaults to the spinner's color. |
Marks the spinner as successful.
Kind: instance method of Spinner
Param | Type | Description |
---|---|---|
text | string |
The success message to display. |
[color] | string |
The color of the success message. Defaults to the spinner's succeedColor. |
Marks the spinner as failed.
Kind: instance method of Spinner
Param | Type | Description |
---|---|---|
text | string |
The failure message to display. |
[color] | string |
The color of the failure message. Defaults to the spinner's failColor. |
Spinner.spinner ⇒ Spinner
Creates a new instance of Spinner.
Kind: static property of Spinner
Returns: Spinner
- A new Spinner instance.
Spinner.Spinner ⇒ Spinner
Returns the Spinner class.
Kind: static property of Spinner
Returns: Spinner
- The Spinner class.
Returns the Spinnies class.
Kind: static property of Spinner
Returns: Spinnies
- The Spinnies class.
Spinner.spins ⇒ Spinner
Gets the singleton instance of the Spinner.
Kind: static property of Spinner
Returns: Spinner
- The singleton instance of the Spinner.
Spinner.spin(opts) ⇒ Spinner
Creates and returns a new spinner with provided options.
Kind: static method of Spinner
Returns: Spinner
- A new Spinner instance.
Param | Type | Description |
---|---|---|
opts | Object |
The options to create a new spinner. |
A singleton instance of the Spinner class. Useful for quick access when only one spinner is needed.
Kind: global variable