From c8e136e6bee9512ef991457caa590a5f6fe65e27 Mon Sep 17 00:00:00 2001 From: Qingyu Deng Date: Thu, 1 Apr 2021 21:34:58 +0800 Subject: [PATCH 1/2] doc: document ctor of ReadStream and WriteStream in tty Fixes: https://github.com/nodejs/node/issues/37780 --- doc/api/tty.md | 26 ++++++++++++++++++++++++++ tools/doc/type-parser.js | 3 +++ 2 files changed, 29 insertions(+) diff --git a/doc/api/tty.md b/doc/api/tty.md index 3cf37ff9cb7cdf..7a99fbf6a487c2 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -43,6 +43,21 @@ 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. +* Returns {tty.WriteStream} + +Creates a WriteStream for `fd` associated with a TTY. + ### Event: `'resize'`