NodeJS REPL stands for Read Eval Print and Loop. It is a quick and easy way to test simple NodeJS code. To launch the NodeJS REPL, just open command prompt (In Windows) or terminal (In Mac or UNIX/Linux) and type node. It will change the prompt to node shell, where you can enter the NodeJS code and it will responds with an output in an interactive mode.
REPL Command | Description |
---|---|
.help | It will display list on all the commands. |
Tab Keys | It will display the list of current commands. |
Up/Down Keys | It is used to see the command history and modify previous commands. |
.save filename | To save current Node REPL session to a file. |
.load filename | To load the specified file in the current Node REPL session. |
ctrl + c | It will terminate the current command. |
ctrl + c (twice) | It will help us to come out of Node REPL session. |
ctrl + d | It will help us to come out of Node REPL session. |
.break | It is used to exit from multiline expression. |
.clear | It is used to exit from multiline expression. |