File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed 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
556556a ` 'resize' ` event on the ` output ` if or when the columns ever change
557557([ ` process.stdout ` ] [ ] does this automatically when it is a TTY).
558558
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+
559570### Use of the ` completer ` function
560571
561572The ` completer ` function takes the current line entered by the user
@@ -891,3 +902,4 @@ const { createInterface } = require('readline');
891902[ `process.stdout` ] : process.md#process_process_stdout
892903[ `rl.close()` ] : #readline_rl_close
893904[ reading files ] : #readline_example_read_file_stream_line_by_line
905+ [ `unref` ] : net.md#net_socket_unref
You can’t perform that action at this time.
0 commit comments