mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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:
1 parent
b09d1f4f04
commit
fbfb61a029
1 file changed
+3
-10
+3
-10
@@ -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
|
||||
Reference in new issue
Block a user