Expand description
Node tty module.
tty.isatty(fd) queries whether a file descriptor is a terminal (via
libc::isatty). tty.ReadStream/tty.WriteStream are exposed as native
classes: a WriteStream carries fd/isTTY/columns/rows and the
cursor/erase methods (cursorTo/moveCursor/clearLine/clearScreenDown/
getWindowSize/getColorDepth/hasColors), all routed — like
process.stdout — through process::stream_instance_call; a ReadStream
carries fd/isTTY/isRaw with a best-effort setRawMode.
Constants§
- METHODS
- READ_
STREAM_ METHODS - Instance methods of a
tty.ReadStream.
Functions§
- call
- constant
require('tty').ReadStream/.WriteStream— expose the classes as constructible builtins (the parent routesnew/instance calls by tag).- construct
new tty.ReadStream(fd)/new tty.WriteStream(fd).- instance_
call - Dispatch a
tty.ReadStreaminstance method. Terminal raw-mode toggling has no termios substrate here, sosetRawModejust records the flag; the rest are chainable no-ops so.on('data')/.pause()/.resume()chains load. - read_
stream - Build a
tty.ReadStreamobject. - window_
size - The terminal’s
(columns, rows)viaioctl(TIOCGWINSZ);Nonewhenfdis not a terminal or the ioctl fails. - write_
stream - Build a
tty.WriteStreamobject (same shape asprocess.stdout).