Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: document ctor of ReadStream and WriteStream in tty #38021

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions doc/api/tty.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])`
<!-- 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.

### `readStream.isRaw`
<!-- YAML
added: v0.7.7
Expand Down Expand Up @@ -88,6 +103,16 @@ 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.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
added: v0.7.7
Expand Down Expand Up @@ -293,6 +318,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#net_new_net_socket_options
[`process.stderr`]: process.md#process_process_stderr
[`process.stdin`]: process.md#process_process_stdin
[`process.stdout`]: process.md#process_process_stdout
Expand Down
3 changes: 3 additions & 0 deletions tools/doc/type-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ const customTypesMap = {

'Tracing': 'tracing.html#tracing_tracing_object',

'tty.ReadStream': 'tty.html#tty_class_tty_readstream',
'tty.WriteStream': 'tty.html#tty_class_tty_writestream',

'URL': 'url.html#url_the_whatwg_url_api',
'URLSearchParams': 'url.html#url_class_urlsearchparams',

Expand Down