Constructor
new ToolsCLI()
Creates an instance of ToolsCLI.
- Source:
Members
StringBuilder :StringTemplateBuilder
The StringTemplateBuilder instance used for constructing string templates.
Type:
- Source:
Methods
boolAnswer(a, strictopt) → {boolean}
Converts a user input to a boolean value, considering 'y' or 'n' as affirmative and negative answers, respectively.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
a |
string | The user input to be converted to a boolean value ('y' or 'n'). |
||
strict |
boolean |
<optional> |
false | If set to true, strict mode requires 'y' or 'n' input only. |
- Source:
Throws:
-
When strict mode is enabled and the input is not 'y' or 'n'.
- Type
- Error.Log
Returns:
The boolean value based on the user input.
- Type
- boolean
print(txt, addHeaderopt)
Prints a message to the console with optional header and project name.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
txt |
string | The text to be printed. |
|
addHeader |
string |
<optional> |
The optional header to be added to the message. |
- Source:
printError(err)
Prints an error message to the console, including error name, message, and stack trace.
Parameters:
| Name | Type | Description |
|---|---|---|
err |
Error | The error object to be printed. |
- Source:
printTable(data, optionsopt)
Prints tabular data to the console as a table.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
Object | The data to be displayed in the table. |
|
options |
Object |
<optional> |
Additional options for printing the table, including headers. |
- Source:
printTemplate(stringContent)
Prints a string template content to the console.
Parameters:
| Name | Type | Description |
|---|---|---|
stringContent |
string | The string template content to be printed. |
- Source: