| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -556,6 +556,17 @@ the best compatibility if it defines an `output.columns` property and emits | |||
| 556 | 556 | a `'resize'` event on the `output` if or when the columns ever change | |
| 557 | 557 | ([`process.stdout`][] does this automatically when it is a TTY). | |
| 558 | 558 | ||
| 559 | + When creating a `readline.Interface` using `stdin` as input, the program | ||
| 560 | + will not terminate until it receives `EOF` (<kbd>Ctrl</kbd>+<kbd>D</kbd> on | ||
| 561 | + Linux/macOS, <kbd>Ctrl</kbd>+<kbd>Z</kbd> followed by <kbd>Return</kbd> on | ||
| 562 | + Windows). | ||
| 563 | + If you want your application to exit without waiting for user input, you can | ||
| 564 | + [`unref`][] the standard input stream: | ||
| 565 | + | ||
| 566 | + ```js | ||
| 567 | + process.stdin.unref(); | ||
| 568 | + ``` | ||
| 569 | + | ||
| 559 | 570 | ### Use of the `completer` function | |
| 560 | 571 | ||
| 561 | 572 | The `completer` function takes the current line entered by the user | |
@@ -891,3 +902,4 @@ const { createInterface } = require('readline'); | |||
| 891 | 902 | [`process.stdout`]: process.md#process_process_stdout | |
| 892 | 903 | [`rl.close()`]: #readline_rl_close | |
| 893 | 904 | [reading files]: #readline_example_read_file_stream_line_by_line | |
| 905 | + [`unref`]: net.md#net_socket_unref | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments