Module

std/node/readline.ts

Deno standard library
Go to Latest
function emitKeypressEvents
import { emitKeypressEvents } from "https://deno.land/std@0.145.0/node/readline.ts";

The readline.emitKeypressEvents() method causes the given Readable stream to begin emitting 'keypress' events corresponding to received input.

Optionally, interface specifies a readline.Interface instance for which autocompletion is disabled when copy-pasted input is detected.

If the stream is a TTY, then it must be in raw mode.

This is automatically called by any readline instance on its input if theinput is a terminal. Closing the readline instance does not stop the input from emitting 'keypress' events.

readline.emitKeypressEvents(process.stdin);
if (process.stdin.isTTY)
  process.stdin.setRawMode(true);

Parameters

optional
readlineInterface: Interface
import emitKeypressEvents
import { emitKeypressEvents } from "https://deno.land/std@0.145.0/node/readline.ts";