We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1808572 commit b3ea8f1Copy full SHA for b3ea8f1
doc/api/readline.md
@@ -16,7 +16,20 @@ const readline = require('readline');
16
17
The following simple example illustrates the basic use of the `readline` module.
18
19
-```js
+```mjs
20
+import * as readline from 'node:readline/promises';
21
+import { stdin as input, stdout as output } from 'node:process';
22
+
23
+const rl = readline.createInterface({ input, output });
24
25
+const answer = await rl.question('What do you think of Node.js? ');
26
27
+console.log(`Thank you for your valuable feedback: ${answer}`);
28
29
+rl.close();
30
+```
31
32
+```cjs
33
const readline = require('readline');
34
35
const rl = readline.createInterface({
0 commit comments