Skip to content

Commit

Permalink
doc: simplify readline/stdin text
Browse files Browse the repository at this point in the history
PR-URL: nodejs#41583
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and Linkgoron committed Jan 31, 2022
1 parent d09bc56 commit 763c7e8
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 763c7e8

Please sign in to comment.