From 3c8f19fcdf60a7b863aca0d09130e733833ced68 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 15 May 2016 23:15:46 -0700 Subject: [PATCH] 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 --- doc/api/tty.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/doc/api/tty.md b/doc/api/tty.md index 6075702b533895..e7214ce9182c6d 100644 --- a/doc/api/tty.md +++ b/doc/api/tty.md @@ -18,29 +18,44 @@ false ``` ## Class: ReadStream + 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 + A `Boolean` that is initialized to `false`. It represents the current "raw" state of the `tty.ReadStream` instance. ### rs.setRawMode(mode) + `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 + 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' + `function () {}` @@ -55,16 +70,25 @@ process.stdout.on('resize', () => { ``` ### 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. ## tty.isatty(fd) + Returns `true` or `false` depending on if the `fd` is associated with a terminal.