mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc,tty: add documentation for ReadStream and WriteStream
Co-authored-by: Qingyu Deng <i@ayase-lab.com> PR-URL: https://github.com/nodejs/node/pull/53567 Fixes: https://github.com/nodejs/node/issues/37780 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Raz Luvaton <rluvaton@gmail.com> Reviewed-By: Claudio Wunder <cwunder@gnome.org>
This commit is contained in:
@@ -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])`
|
||||
|
||||
<!-- YAML
|
||||
added: v0.5.8
|
||||
changes:
|
||||
- version: v0.9.4
|
||||
description: The `options` argument is supported.
|
||||
-->
|
||||
|
||||
* `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)`
|
||||
|
||||
<!-- YAML
|
||||
added: v0.5.8
|
||||
-->
|
||||
|
||||
* `fd` {number} A file descriptor associated with a TTY.
|
||||
* Returns {tty.WriteStream}
|
||||
|
||||
Creates a `WriteStream` for `fd` associated with a TTY.
|
||||
|
||||
### Event: `'resize'`
|
||||
|
||||
<!-- YAML
|
||||
@@ -314,6 +341,7 @@ The `tty.isatty()` method returns `true` if the given `fd` is associated with
|
||||
a TTY and `false` if it is not, including whenever `fd` is not a non-negative
|
||||
integer.
|
||||
|
||||
[`net.Socket` constructor]: net.md#new-netsocketoptions
|
||||
[`process.stderr`]: process.md#processstderr
|
||||
[`process.stdin`]: process.md#processstdin
|
||||
[`process.stdout`]: process.md#processstdout
|
||||
|
||||
@@ -223,6 +223,9 @@ const customTypesMap = {
|
||||
|
||||
'Tracing': 'tracing.html#tracing-object',
|
||||
|
||||
'tty.ReadStream': 'tty.html#class-ttyreadstream',
|
||||
'tty.WriteStream': 'tty.html#class-ttywritestream',
|
||||
|
||||
'URL': 'url.html#the-whatwg-url-api',
|
||||
'URLSearchParams': 'url.html#class-urlsearchparams',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user