Browse Source

doc: add `added:` in for `tty`

Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/6783
Reviewed-By: James M Snell <jasnell@gmail.com>
v4.x
Rich Trott 9 years ago
committed by Myles Borins
parent
commit
3c8f19fcdf
  1. 24
      doc/api/tty.md

24
doc/api/tty.md

@ -18,29 +18,44 @@ false
``` ```
## Class: ReadStream ## Class: ReadStream
<!-- YAML
added: v0.5.8
-->
A `net.Socket` subclass that represents the readable portion of a tty. In normal 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 circumstances, `process.stdin` will be the only `tty.ReadStream` instance in any
Node.js program (only when `isatty(0)` is true). Node.js program (only when `isatty(0)` is true).
### rs.isRaw ### rs.isRaw
<!-- YAML
added: v0.7.7
-->
A `Boolean` that is initialized to `false`. It represents the current "raw" state A `Boolean` that is initialized to `false`. It represents the current "raw" state
of the `tty.ReadStream` instance. of the `tty.ReadStream` instance.
### rs.setRawMode(mode) ### rs.setRawMode(mode)
<!-- YAML
added: v0.7.7
-->
`mode` should be `true` or `false`. This sets the properties of the `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 `tty.ReadStream` to act either as a raw device or default. `isRaw` will be set
to the resulting mode. to the resulting mode.
## Class: WriteStream ## Class: WriteStream
<!-- YAML
added: v0.5.8
-->
A `net.Socket` subclass that represents the writable portion of a tty. In normal A `net.Socket` subclass that represents the writable portion of a tty. In normal
circumstances, `process.stdout` will be the only `tty.WriteStream` instance circumstances, `process.stdout` will be the only `tty.WriteStream` instance
ever created (and only when `isatty(1)` is true). ever created (and only when `isatty(1)` is true).
### Event: 'resize' ### Event: 'resize'
<!-- YAML
added: v0.7.7
-->
`function () {}` `function () {}`
@ -55,16 +70,25 @@ process.stdout.on('resize', () => {
``` ```
### ws.columns ### ws.columns
<!-- YAML
added: v0.7.7
-->
A `Number` that gives the number of columns the TTY currently has. This property A `Number` that gives the number of columns the TTY currently has. This property
gets updated on `'resize'` events. gets updated on `'resize'` events.
### ws.rows ### ws.rows
<!-- YAML
added: v0.7.7
-->
A `Number` that gives the number of rows the TTY currently has. This property A `Number` that gives the number of rows the TTY currently has. This property
gets updated on `'resize'` events. gets updated on `'resize'` events.
## tty.isatty(fd) ## tty.isatty(fd)
<!-- YAML
added: v0.5.8
-->
Returns `true` or `false` depending on if the `fd` is associated with a Returns `true` or `false` depending on if the `fd` is associated with a
terminal. terminal.

Loading…
Cancel
Save