Skip to main content
ReadStream - tty - Node documentation
class ReadStream
extends net.Socket

Usage in Deno

import { ReadStream } from "node:tty";

Represents the readable side of a TTY. In normal circumstances process.stdin will be the only tty.ReadStream instance in a Node.js process and there should be no reason to create additional instances.

Constructors

new
ReadStream(
fd: number,
options?: net.SocketConstructorOpts,
)

Properties

isRaw: boolean

A boolean that is true if the TTY is currently configured to operate as a raw device.

This flag is always false when a process starts, even if the terminal is operating in raw mode. Its value will change with subsequent calls to setRawMode.

isTTY: boolean

A boolean that is always true for tty.ReadStream instances.

Methods

setRawMode(mode: boolean): this

Allows configuration of tty.ReadStream so that it operates as a raw device.

When in raw mode, input is always available character-by-character, not including modifiers. Additionally, all special processing of characters by the terminal is disabled, including echoing input characters. Ctrl+C will no longer cause a SIGINT when in this mode.