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: add added: in for tty #6783

Closed
wants to merge 1 commit into from
Closed
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
24 changes: 24 additions & 0 deletions doc/api/tty.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,44 @@ false
```

## Class: ReadStream
<!-- YAML
added: v0.5.8
-->

A `net.Socket` subclass that represents the readable portion of a tty. In normal
circumstances, `process.stdin` will be the only `tty.ReadStream` instance in any
Node.js program (only when `isatty(0)` is true).

### rs.isRaw
<!-- YAML
added: v0.7.7
-->

A `Boolean` that is initialized to `false`. It represents the current "raw" state
of the `tty.ReadStream` instance.

### rs.setRawMode(mode)
<!-- YAML
added: v0.7.7
-->

`mode` should be `true` or `false`. This sets the properties of the
`tty.ReadStream` to act either as a raw device or default. `isRaw` will be set
to the resulting mode.

## Class: WriteStream
<!-- YAML
added: v0.5.8
-->

A `net.Socket` subclass that represents the writable portion of a tty. In normal
circumstances, `process.stdout` will be the only `tty.WriteStream` instance
ever created (and only when `isatty(1)` is true).

### Event: 'resize'
<!-- YAML
added: v0.7.7
-->

`function () {}`

Expand All @@ -55,16 +70,25 @@ process.stdout.on('resize', () => {
```

### ws.columns
<!-- YAML
added: v0.7.7
-->

A `Number` that gives the number of columns the TTY currently has. This property
gets updated on `'resize'` events.

### ws.rows
<!-- YAML
added: v0.7.7
-->

A `Number` that gives the number of rows the TTY currently has. This property
gets updated on `'resize'` events.

## tty.isatty(fd)
<!-- YAML
added: v0.5.8
-->

Returns `true` or `false` depending on if the `fd` is associated with a
terminal.
Expand Down