Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/deno/cli/dts/lib.deno.window.d.ts>prompt

A modern runtime for JavaScript and TypeScript.
Go to Latest
function prompt
import { prompt } from "https://deno.land/x/deno@v1.28.0/cli/dts/lib.deno.window.d.ts";

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.

Parameters

optional
message: string
optional
defaultValue: string

Returns

string | null