@@ -12,9 +12,9 @@ However, it can be accessed using:
12
12
const tty = require (' tty' );
13
13
```
14
14
15
- When Node.js detects that it is being run inside a text terminal ("TTY")
16
- context, the ` process.stdin ` will, by default, be initialized as an instance of
17
- ` tty.ReadStream ` and both ` process.stdout ` and ` process.stderr ` will, by
15
+ When Node.js detects that it is being run with a text terminal ("TTY")
16
+ attached, [ ` process.stdin ` ] [ ] will, by default, be initialized as an instance of
17
+ ` tty.ReadStream ` and both [ ` process.stdout ` ] [ ] and [ ` process.stderr ` ] [ ] will, by
18
18
default be instances of ` tty.WriteStream ` . The preferred method of determining
19
19
whether Node.js is being run within a TTY context is to check that the value of
20
20
the ` process.stdout.isTTY ` property is ` true ` :
@@ -27,15 +27,16 @@ false
27
27
```
28
28
29
29
In most cases, there should be little to no reason for an application to
30
- create instances of the ` tty.ReadStream ` and ` tty.WriteStream ` classes.
30
+ manually create instances of the ` tty.ReadStream ` and ` tty.WriteStream `
31
+ classes.
31
32
32
33
## Class: tty.ReadStream
33
34
<!-- YAML
34
35
added: v0.5.8
35
36
-->
36
37
37
- The ` tty.ReadStream ` class is a subclass of ` net.Socket ` that represents the
38
- readable side of a TTY. In normal circumstances ` process.stdin ` will be the
38
+ The ` tty.ReadStream ` class is a subclass of [ ` net.Socket ` ] [ ] that represents the
39
+ readable side of a TTY. In normal circumstances [ ` process.stdin ` ] [ ] will be the
39
40
only ` tty.ReadStream ` instance in a Node.js process and there should be no
40
41
reason to create additional instances.
41
42
@@ -52,7 +53,7 @@ raw device. Defaults to `false`.
52
53
added: v0.5.8
53
54
-->
54
55
55
- A ` boolean ` that is always ` true ` .
56
+ A ` boolean ` that is always ` true ` for ` tty.ReadStream ` instances .
56
57
57
58
### readStream.setRawMode(mode)
58
59
<!-- YAML
@@ -77,8 +78,8 @@ added: v0.5.8
77
78
-->
78
79
79
80
The ` tty.WriteStream ` class is a subclass of ` net.Socket ` that represents the
80
- writable side of a TTY. In normal circumstances, ` process.stdout ` and
81
- ` process.stderr ` will be the only ` tty.WriteStream ` instances created for a
81
+ writable side of a TTY. In normal circumstances, [ ` process.stdout ` ] [ ] and
82
+ [ ` process.stderr ` ] [ ] will be the only ` tty.WriteStream ` instances created for a
82
83
Node.js process and there should be no reason to create additional instances.
83
84
84
85
### Event: 'resize'
@@ -130,3 +131,8 @@ added: v0.5.8
130
131
The ` tty.isatty() ` method returns ` true ` if the given ` fd ` is associated with
131
132
a TTY and ` false ` if it is not, including whenever ` fd ` is not a non-negative
132
133
integer.
134
+
135
+ [ `net.Socket` ] : net.html#net_class_net_socket
136
+ [ `process.stdin` ] : process.html#process_process_stdin
137
+ [ `process.stdout` ] : process.html#process_process_stdout
138
+ [ `process.stderr` ] : process.html#process_process_stderr
0 commit comments