Constructor
new Print(plugin, optionsopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
plugin | Plugin | Plugin instance | ||
options | TPrintOptions | <optional> | {} | Options object |
- Source
Members
app :App
The app instance
- Source
buildText
Translate, prefixed with counter and/or datetime etc
- Source
options :TPrintOptions
Options object
- Source
ora
ora instance
- Source
- See
plugin :Plugin
Attached plugin
- Source
startTime :Object
Time when instance is created
- Object
- Source
- See
- dayjs object
Methods
clear() → {Print}
Clear spinner text
- Source
Return the instance itself, usefull for method chaining
- Type:
fail(text, …argsopt) → {Print}
Print failed message, prefixed with a cross icon
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora options |
- Source
Return the instance itself, usefull for method chaining
- Type:
fatal(text, …argsopt)
Print failed message, prefixed with a cross icon and exit
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora options |
- Source
getElapsed(unitopt) → {string}
Get elapsed time since instance is created
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
unit | string | <optional> | hms | Unit's time. Put 'hms' (default) to get hour, minute, second format or of any format supported by dayjs |
- Source
Elapsed time since start
- Type:
- string
info(text, …argsopt) → {Print}
Print information message, prefixed with an info icon
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora options |
- Source
Return the instance itself, usefull for method chaining
- Type:
render() → {Print}
Force render spinner
- Source
Return the instance itself, usefull for method chaining
- Type:
setOpts(argsopt)
Setting spinner options; override the one passed at constructor
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
args | Array.<any> | <optional> | [] | Array of options. If the last argument is an object, it will be used to override ora options |
- Source
setText(text, …argsopt) → {Print}
Set spinner's text
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora's options |
- Source
Return the instance itself, usefull for method chaining
- Type:
spinner(optionsopt) → {Print}
Create a new print instance
Name | Type | Attributes | Description |
---|---|---|---|
options | TPrintOptions | <optional> | Options object. If not provided, defaults to the current options |
- Source
Return new print instance
- Type:
start(text, …argsopt) → {Print}
Start the spinner
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora's options |
- Source
Return the instance itself, usefull for method chaining
- Type:
stop() → {Print}
Stop the spinner
- Source
Return the instance itself, usefull for method chaining
- Type:
succeed(text, …argsopt) → {Print}
Print success message, prefixed with a check icon
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora options |
- Source
Return the instance itself, usefull for method chaining
- Type:
warn(text, …argsopt) → {Print}
Print warning message, prefixed with a warn icon
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Text to use | |
args | any | <optional> <repeatable> | Any variable to interpolate text. If the last argument is an object, it will be used to override ora options |
- Source
Return the instance itself, usefull for method chaining
- Type: