| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -633,6 +633,17 @@ the best compatibility if it defines an `output.columns` property and emits | |||
| 633 | 633 | a `'resize'` event on the `output` if or when the columns ever change | |
| 634 | 634 | ([`process.stdout`][] does this automatically when it is a TTY). | |
| 635 | 635 | ||
| 636 | + When creating a `readline.Interface` using `stdin` as input, the program | ||
| 637 | + will not terminate until it receives `EOF` (<kbd>Ctrl</kbd>+<kbd>D</kbd> on | ||
| 638 | + Linux/macOS, <kbd>Ctrl</kbd>+<kbd>Z</kbd> followed by <kbd>Return</kbd> on | ||
| 639 | + Windows). | ||
| 640 | + If you want your application to exit without waiting for user input, you can | ||
| 641 | + [`unref`][] the standard input stream: | ||
| 642 | + | ||
| 643 | + ```js | ||
| 644 | + process.stdin.unref(); | ||
| 645 | + ``` | ||
| 646 | + | ||
| 636 | 647 | ### Use of the `completer` function | |
| 637 | 648 | ||
| 638 | 649 | The `completer` function takes the current line entered by the user | |
@@ -968,3 +979,4 @@ const { createInterface } = require('readline'); | |||
| 968 | 979 | [`process.stdout`]: process.md#process_process_stdout | |
| 969 | 980 | [`rl.close()`]: #readline_rl_close | |
| 970 | 981 | [reading files]: #readline_example_read_file_stream_line_by_line | |
| 982 | + [`unref`]: net.md#net_socket_unref | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments