doc: simplify readline/stdin text

PR-URL: https://github.com/nodejs/node/pull/41583
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Rich Trott authored and GitHub committed 2022-01-23 03:21:17 +00:00
1 parent b09d1f4f04
commit fbfb61a029
1 file changed
+3 -10
+3 -10
View File
@@ -1059,15 +1059,8 @@ a `'resize'` event on the `output` if or when the columns ever change
([`process.stdout`][] does this automatically when it is a TTY).
When creating a `readline.Interface` using `stdin` as input, the program
will not terminate until it receives `EOF` (<kbd>Ctrl</kbd>+<kbd>D</kbd> on
Linux/macOS, <kbd>Ctrl</kbd>+<kbd>Z</kbd> followed by <kbd>Return</kbd> on
Windows).
If you want your application to exit without waiting for user input, you can
[`unref()`][] the standard input stream:
```js
process.stdin.unref();
```
will not terminate until it receives an [EOF character][]. To exit without
waiting for user input, call `process.stdin.unref()`.
#### Use of the `completer` function
@@ -1411,6 +1404,7 @@ const { createInterface } = require('readline');
</tr>
</table>
[EOF character]: https://en.wikipedia.org/wiki/End-of-file#EOF_character
[Readable]: stream.md#readable-streams
[TTY]: tty.md
[TTY keybindings]: #tty-keybindings
@@ -1422,5 +1416,4 @@ const { createInterface } = require('readline');
[`process.stdin`]: process.md#processstdin
[`process.stdout`]: process.md#processstdout
[`rl.close()`]: #rlclose
[`unref()`]: net.md#socketunref
[reading files]: #example-read-file-stream-line-by-line