Skip to content

Commit 0295d77

Browse files
zZMoZzavivkeller
andauthored
docs: improve Node REPL dot commands explanation (#71)
* docs: improve Node REPL dot commands explanation - 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> * Apply review suggestions Co-authored-by: Aviv Keller <me@aviv.sh> Signed-off-by: Mohamed Mohsen <zmohamedmohsnz@gmail.com> * Remove misleading note about .clear command Signed-off-by: Mohamed Mohsen <zmohamedmohsnz@gmail.com> --------- Signed-off-by: Mohamed Mohsen <zmohamedmohsnz@gmail.com> Co-authored-by: Aviv Keller <me@aviv.sh>
1 parent 3a8d092 commit 0295d77

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

pages/command-line/how-to-use-the-nodejs-repl.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,12 @@ If you press the `up` arrow key, you will get access to the history of the previ
8787

8888
The REPL has some special commands, all starting with a dot `.`. They are
8989

90-
- `.help`: shows the dot commands help
91-
- `.editor`: enables editor mode, to write multiline JavaScript code with ease. Once you are in this mode, enter ctrl-D to run the code you wrote.
92-
- `.break`: when inputting a multi-line expression, entering the .break command will abort further input. Same as pressing ctrl-C.
93-
- `.clear`: resets the REPL context to an empty object and clears any multi-line expression currently being input.
94-
- `.load`: loads a JavaScript file, relative to the current working directory
95-
- `.save`: saves all you entered in the REPL session to a file (specify the filename)
96-
- `.exit`: exits the repl (same as pressing ctrl-C two times)
90+
- `.help`: shows the dot commands help.
91+
- `.editor`: enters editor mode, to write multiline JavaScript code.
92+
- `.break` / `.clear`: exits multi-line code like functions. Same as pressing CTRL-C.
93+
- `.load`: loads a JavaScript file, relative to the current working directory.
94+
- `.save`: saves all commands you entered in the session to a file.
95+
- `.exit`: exits the REPL (same as pressing CTRL-C twice).
9796

9897
The REPL knows when you are typing a multi-line statement without the need to invoke `.editor`.
9998

0 commit comments

Comments
 (0)