Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a04cd85

Browse filesBrowse files
akkiFishrock123
authored andcommitted
doc: fix repl defineCommand example
Fixes: #7357 PR-URL: #7365 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 029af2c commit a04cd85
Copy full SHA for a04cd85

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎doc/api/repl.md‎

Copy file name to clipboardExpand all lines: doc/api/repl.md
+2-2Lines changed: 2 additions & 2 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,12 @@ replServer.defineCommand('sayhello', {
312312
action: function(name) {
313313
this.lineParser.reset();
314314
this.bufferedCommand = '';
315-
this.write(`Hello, ${name}!\n`);
315+
console.log(`Hello, ${name}!`);
316316
this.displayPrompt();
317317
}
318318
});
319319
replServer.defineCommand('saybye', function() {
320-
this.write('Goodbye!\n');
320+
console.log('Goodbye!');
321321
this.close();
322322
});
323323
```

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.