From c643d2bfa84156838b352396eeb82636f1acd2fc Mon Sep 17 00:00:00 2001 From: Jianru Lin Date: Thu, 10 Jul 2025 14:37:56 +0800 Subject: [PATCH] docs: fix tty.ReadStream constructor placement The `new tty.ReadStream(fd[, options])` constructor documentation was incorrectly placed under the `tty.WriteStream` class heading. This commit moves the documentation for the `tty.ReadStream` constructor to its correct location under the `tty.ReadStream` class heading, improving the accuracy and readability of the `tty` module documentation. --- doc/api/tty.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/api/tty.md b/doc/api/tty.md index 1139355ed0f280..beafcecd5c397d 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -44,6 +44,22 @@ 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. +### `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. + ### `readStream.isRaw` - -* `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)`