From 3cdf94d403460f1f1474c15e808f78408bb0c272 Mon Sep 17 00:00:00 2001 From: jakecastelli <38635403+jakecastelli@users.noreply.github.com> Date: Fri, 19 Jul 2024 17:53:24 +0700 Subject: [PATCH] doc,tty: add documentation for ReadStream and WriteStream Co-authored-by: Qingyu Deng PR-URL: https://github.com/nodejs/node/pull/53567 Fixes: https://github.com/nodejs/node/issues/37780 Reviewed-By: Luigi Pinca Reviewed-By: Raz Luvaton Reviewed-By: Claudio Wunder --- doc/api/tty.md | 28 ++++++++++++++++++++++++++++ tools/doc/type-parser.mjs | 3 +++ 2 files changed, 31 insertions(+) diff --git a/doc/api/tty.md b/doc/api/tty.md index 1234526dd588dd..1139355ed0f280 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -98,6 +98,33 @@ Represents the writable side of a TTY. In normal circumstances, `tty.WriteStream` instances created for a Node.js process and there should be no reason to create additional instances. +### `new tty.ReadStream(fd[, options])` + + + +* `fd` {number} A file descriptor associated with a TTY. +* `options` {Object} Options passed to parent `net.Socket`, + see `options` of [`net.Socket` constructor][]. +* Returns {tty.ReadStream} + +Creates a `ReadStream` for `fd` associated with a TTY. + +### `new tty.WriteStream(fd)` + + + +* `fd` {number} A file descriptor associated with a TTY. +* Returns {tty.WriteStream} + +Creates a `WriteStream` for `fd` associated with a TTY. + ### Event: `'resize'`