Skip to content

Commit

Permalink
doc: sort tty alphabetically
Browse files Browse the repository at this point in the history
Reorders, with no contextual changes, the tty documentation
alphabetically.

PR-URL: #3662
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information
tflanagan authored and jasnell committed Dec 17, 2015
1 parent 3c20687 commit af876dd
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions doc/api/tty.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ in a TTY context is to check `process.stdout.isTTY`:
$ node -p -e "Boolean(process.stdout.isTTY)" | cat
false


## tty.isatty(fd)

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


## tty.setRawMode(mode)

Stability: 0 - Deprecated: Use [tty.ReadStream#setRawMode][] (i.e. process.stdin.setRawMode) instead.


## Class: ReadStream

A `net.Socket` subclass that represents the readable portion of a tty. In normal
Expand All @@ -44,23 +32,14 @@ of the `tty.ReadStream` instance.
`tty.ReadStream` to act either as a raw device or default. `isRaw` will be set
to the resulting mode.

[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode

## Class: WriteStream

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).

### ws.columns

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

### ws.rows

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

### Event: 'resize'

`function () {}`
Expand All @@ -73,5 +52,21 @@ has changed.
console.log(process.stdout.columns + 'x' + process.stdout.rows);
});

### ws.columns

[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode
A `Number` that gives the number of columns the TTY currently has. This property
gets updated on "resize" events.

### ws.rows

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

## tty.isatty(fd)

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

## tty.setRawMode(mode)

Stability: 0 - Deprecated: Use [tty.ReadStream#setRawMode][] (i.e. process.stdin.setRawMode) instead.

0 comments on commit af876dd

Please sign in to comment.