method REPLServer.prototype.displayPrompt
Usage in Deno
import { REPLServer } from "node:repl";
REPLServer.prototype.displayPrompt(preserveCursor?: boolean): void
The replServer.displayPrompt()
method readies the REPL instance for input
from the user, printing the configured prompt
to a new line in the output
and resuming the input
to accept new input.
When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'.
When preserveCursor
is true
, the cursor placement will not be reset to 0
.
The replServer.displayPrompt
method is primarily intended to be called from
within the action function for commands registered using thereplServer.defineCommand()
method.
void