Skip to content

Commit

Permalink
apply suggestions from @redyetidev code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mfdebian committed Oct 14, 2024
1 parent 24205e8 commit 9b79bbc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,10 @@ const rl = createInterface({

```cjs
const { createInterface } = require('node:readline/promises');
const { stdin: input, stdout: output } = require('node:process');
const rl = createInterface({ input, output });
const rl = createInterface({
input: process.stdin,
output: process.stdout,
});
```

Once the `readlinePromises.Interface` instance is created, the most common case
Expand Down Expand Up @@ -978,8 +980,10 @@ const rl = createInterface({

```cjs
const { createInterface } = require('node:readline');
const { stdin: input, stdout: output } = require('node:process');
const rl = createInterface({ input, output });
const rl = createInterface({
input: process.stdin,
output: process.stdout,
});
```

Once the `readline.Interface` instance is created, the most common case is to
Expand Down Expand Up @@ -1141,10 +1145,9 @@ rl.on('line', (line) => {

```cjs
const { createInterface } = require('node:readline');
const { exit, stdin, stdout } = require('node:process');
const rl = createInterface({
input: stdin,
output: stdout,
input: process.stdin,
output: process.stdout,
prompt: 'OHAI> ',
});

Expand All @@ -1162,7 +1165,7 @@ rl.on('line', (line) => {
rl.prompt();
}).on('close', () => {
console.log('Have a great day!');
exit(0);
process.exit(0);
});
```

Expand Down

0 comments on commit 9b79bbc

Please sign in to comment.