Repl.ask() method
Repl.ask() method
Section titled “Repl.ask() method”Asks a yes/no question and waits for a valid response, resolving with the answer.
Signature:
ask(prompt: string): Promise<string>;Parameters
Section titled “Parameters”|
Parameter |
Type |
Description |
|---|---|---|
|
prompt |
string |
The question to present to the user, describing the decision at hand. |
Returns:
Promise<string>
A promise that resolves to “y” or “n” based on the user’s input.