Constructor
(package) new ProgressBar(options)
Initialize the ProgressBar
class with specific options to configure the
progress bar.
Parameters:
Name | Type | Description |
---|---|---|
options |
ProgressBarOptions | Options object for configuring the progress bar. |
- Since:
- 1.0.0
- Source:
Members
idxLoading :number
Index for the loading animation.
Type:
- number
- Source:
loadings :'\'|'|'|'/'|'-'
Characters for the loading animation.
Type:
- '\' | '|' | '/' | '-'
- Default Value:
["\\","|","/","-"]
- Source:
options :ResolvedProgressBarOptions
Options object for configuring the progress bar.
Type:
- ResolvedProgressBarOptions
- Source:
Methods
create(bytesDownloaded, totalBytes) → {string}
Creates a string formatted download progress bar with centered percentage.
Parameters:
Name | Type | Description |
---|---|---|
bytesDownloaded |
number | The number of bytes downloaded so far. |
totalBytes |
number | The total number of bytes to download. |
- Since:
- 1.0.0
- Source:
Returns:
The formatted progress bar string with percentage and byte information.
- Type
- string