W3cubDocs

/Deno

prompt

Shows the given message and waits for the user's input. Returns the user's input as string. If the default value is given and the user inputs the empty string, then it returns the given default value. If the default value is not given and the user inputs the empty string, it returns null. If the stdin is not interactive, it returns null.

function prompt(message?: string, defaultValue?: string): string | null;
prompt(message?: string, defaultValue?: string): string | null

Parameters

message?: string optional
defaultValue?: string optional

Return Type

string | null

© 2018–2021 the Deno authors
https://doc.deno.land/deno/stable/~/prompt