@@ -714,8 +714,10 @@ const rl = createInterface({
714714
715715``` cjs
716716const { createInterface } = require (' node:readline/promises' );
717- const { stdin: input , stdout: output } = require (' node:process' );
718- const rl = createInterface ({ input, output });
717+ const rl = createInterface ({
718+ input: process .stdin ,
719+ output: process .stdout ,
720+ });
719721```
720722
721723Once the ` readlinePromises.Interface ` instance is created, the most common case
@@ -978,8 +980,10 @@ const rl = createInterface({
978980
979981``` cjs
980982const { createInterface } = require (' node:readline' );
981- const { stdin: input , stdout: output } = require (' node:process' );
982- const rl = createInterface ({ input, output });
983+ const rl = createInterface ({
984+ input: process .stdin ,
985+ output: process .stdout ,
986+ });
983987```
984988
985989Once the ` readline.Interface ` instance is created, the most common case is to
@@ -1141,10 +1145,9 @@ rl.on('line', (line) => {
11411145
11421146``` cjs
11431147const { createInterface } = require (' node:readline' );
1144- const { exit , stdin , stdout } = require (' node:process' );
11451148const rl = createInterface ({
1146- input: stdin,
1147- output: stdout,
1149+ input: process . stdin ,
1150+ output: process . stdout ,
11481151 prompt: ' OHAI> ' ,
11491152});
11501153
@@ -1162,7 +1165,7 @@ rl.on('line', (line) => {
11621165 rl .prompt ();
11631166}).on (' close' , () => {
11641167 console .log (' Have a great day!' );
1165- exit (0 );
1168+ process . exit (0 );
11661169});
11671170```
11681171
0 commit comments