Skip to content

Commit 05f39ed

Browse files
committed
doc: readline.emitKeypressEvents note
1 parent 3c1e5b3 commit 05f39ed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

doc/api/readline.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ rl.question('What do you think of Node.js? ', (answer) => {
2727
});
2828
```
2929

30-
*Note* Once this code is invoked, the Node.js application will not
30+
*Note*: Once this code is invoked, the Node.js application will not
3131
terminate until the `readline.Interface` is closed because the interface
3232
waits for data to be received on the `input` stream.
3333

@@ -447,6 +447,10 @@ autocompletion is disabled when copy-pasted input is detected.
447447

448448
If the `stream` is a [TTY][], then it must be in raw mode.
449449

450+
*Note*: This is automatically called by any readline instance on its `input`
451+
if the `input` is a terminal. Closing the `readline` instance does not stop
452+
the `input` from emitting `'keypress'` events.
453+
450454
```js
451455
readline.emitKeypressEvents(process.stdin);
452456
if (process.stdin.isTTY)

0 commit comments

Comments
 (0)