Namespace: codemelted_console

codemelted_console

Provides the console use case function to gather data via a terminal. The actions correspond to the type of input / output that will be interacted with via STDIN and STDOUT.
Source:

Methods

(static) alert(params) → {void}

Alerts a message to STDOUT with a [Enter] to halt execution.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
message string The message to display to STDOUT.
Source:
Returns:
Type
void

(static) choose(params) → {number}

Prompts a list of choices for the user to select from.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
message string The message to display to STDOUT.
choices Array.<string> The choices to select from.
Source:
Returns:
The index of the chosen item.
Type
number

(static) confirm(params) → {boolean}

Prompts a [y/N] to STDOUT with the message as a question.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
message string The message to display to STDOUT.
Source:
Returns:
true if y selected, false otherwise.
Type
boolean

(static) password(params) → {string}

Prompts for a password not showing the text typed via STDIN.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
message string The message to display to STDOUT.
Source:
Returns:
The typed password.
Type
string

(static) prompt(params) → (nullable) {string}

Prompts to STDOUT and returns the typed message via STDIN.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
message string The message to display to STDOUT.
Source:
Returns:
The result typed.
Type
string

(static) writeln(params) → {void}

Write a message to STDOUT.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
message string The message to display to STDOUT.
Source:
Returns:
Type
void