Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cdf94d

Browse filesBrowse files
jakecastelliAyase-252
authored andcommitted
doc,tty: add documentation for ReadStream and WriteStream
Co-authored-by: Qingyu Deng <i@ayase-lab.com> PR-URL: #53567 Fixes: #37780 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Claudio Wunder <cwunder@gnome.org>
1 parent 233aba9 commit 3cdf94d
Copy full SHA for 3cdf94d

2 files changed

+31Lines changed: 31 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/tty.md‎

Copy file name to clipboardExpand all lines: doc/api/tty.md
+28Lines changed: 28 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,33 @@ Represents the writable side of a TTY. In normal circumstances,
9898
`tty.WriteStream` instances created for a Node.js process and there
9999
should be no reason to create additional instances.
100100

101+
### `new tty.ReadStream(fd[, options])`
102+
103+
<!-- YAML
104+
added: v0.5.8
105+
changes:
106+
- version: v0.9.4
107+
description: The `options` argument is supported.
108+
-->
109+
110+
* `fd` {number} A file descriptor associated with a TTY.
111+
* `options` {Object} Options passed to parent `net.Socket`,
112+
see `options` of [`net.Socket` constructor][].
113+
* Returns {tty.ReadStream}
114+
115+
Creates a `ReadStream` for `fd` associated with a TTY.
116+
117+
### `new tty.WriteStream(fd)`
118+
119+
<!-- YAML
120+
added: v0.5.8
121+
-->
122+
123+
* `fd` {number} A file descriptor associated with a TTY.
124+
* Returns {tty.WriteStream}
125+
126+
Creates a `WriteStream` for `fd` associated with a TTY.
127+
101128
### Event: `'resize'`
102129

103130
<!-- YAML
@@ -314,6 +341,7 @@ The `tty.isatty()` method returns `true` if the given `fd` is associated with
314341
a TTY and `false` if it is not, including whenever `fd` is not a non-negative
315342
integer.
316343

344+
[`net.Socket` constructor]: net.md#new-netsocketoptions
317345
[`process.stderr`]: process.md#processstderr
318346
[`process.stdin`]: process.md#processstdin
319347
[`process.stdout`]: process.md#processstdout
Collapse file

‎tools/doc/type-parser.mjs‎

Copy file name to clipboardExpand all lines: tools/doc/type-parser.mjs
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,9 @@ const customTypesMap = {
219219

220220
'Tracing': 'tracing.html#tracing-object',
221221

222+
'tty.ReadStream': 'tty.html#class-ttyreadstream',
223+
'tty.WriteStream': 'tty.html#class-ttywritestream',
224+
222225
'URL': 'url.html#the-whatwg-url-api',
223226
'URLSearchParams': 'url.html#class-urlsearchparams',
224227

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.