Skip to content

docs: improve Node REPL dot commands explanation#71

Open
zZMoZz wants to merge 5 commits into
nodejs:mainfrom
zZMoZz:patch-1
Open

docs: improve Node REPL dot commands explanation#71
zZMoZz wants to merge 5 commits into
nodejs:mainfrom
zZMoZz:patch-1

Conversation

@zZMoZz
Copy link
Copy Markdown

@zZMoZz zZMoZz commented May 13, 2026

  • Group .clear and .break together as equivalent in default REPL
  • Simplify descriptions of dot commands
  • Clarify that .clear only resets context in custom programmatic REPL

- Group `.clear` and `.break` together as equivalent in default REPL
- Simplify descriptions of dot commands
- Clarify that `.clear` only resets context in custom programmatic REPL

Signed-off-by: Mohamed Mohsen <zmohamedmohsnz@gmail.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-learn Ready Ready Preview Jun 3, 2026 1:33pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented May 13, 2026

PR Summary

Low Risk
Documentation-only edits to REPL command descriptions with no runtime or API impact.

Overview
Updates the Dot commands section in how-to-use-the-nodejs-repl.md by replacing the old -- list with shorter markdown bullets and tighter wording for each REPL dot command.

.break and .clear are documented on one line as equivalent ways to leave multi-line input (like CTRL-C), instead of separate entries that described .clear as resetting context and clearing buffered input. .editor no longer mentions ctrl-D to run code; .save / .exit descriptions are simplified and key names use consistent CTRL-C spelling.

Reviewed by Cursor Bugbot for commit 4c02066. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/repl

Please review the changes when you have a chance. Thank you! 🙏

Comment thread pages/command-line/how-to-use-the-nodejs-repl.md Outdated
Comment thread pages/command-line/how-to-use-the-nodejs-repl.md
Comment thread pages/command-line/how-to-use-the-nodejs-repl.md Outdated
Comment thread pages/command-line/how-to-use-the-nodejs-repl.md
Co-authored-by: Aviv Keller <me@aviv.sh>
Signed-off-by: Mohamed Mohsen <zmohamedmohsnz@gmail.com>
@zZMoZz
Copy link
Copy Markdown
Author

zZMoZz commented May 16, 2026

Hi, I’ve applied all the suggested changes and updated the branch.
Could you please review again and approve if everything looks good? Thanks!

@zZMoZz
Copy link
Copy Markdown
Author

zZMoZz commented May 26, 2026

Is there any new news?

- `.break` / `.clear`: exits multi-line code like functions. Same as pressing CTRL-C.
- `.load`: loads a JavaScript file, relative to the current working directory.
- `.save`: saves all commands you entered in the session to a file.
-
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-

Comment on lines +118 to +123
`.clear` clear the whole REPL context like restarting the session only in a custom REPL created programmatically:

```console
require('repl').start();
```

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this added?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested .clear in the terminal REPL, but it doesn't actually reset the REPL context, variables are stayed there. I tested it also now in a code file, the same thing so I believe I should remove this note.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the code recently. Can you check it?

Signed-off-by: Mohamed Mohsen <zmohamedmohsnz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants