REPL Terminal - Node.js
REPL stands for Read Eval Print Loop and it represents a computer environment like a Windows console or Unix/Linux shell where a command is entered and the system responds with an output in an interactive mode. Node.js or Node comes bundled with a REPL environment. It performs the following tasks −
- Eval − Takes and evaluates the data structure.
- Print − Prints the result.
- Loop − Loops the above command until the user presses ctrl-c twice.
REPL can be started by simply running node on shell/console without any arguments as follows.
As mentioned above, you will need to use ctrl-c twice to come out of Node.js REPL
(^C again to quit)
- ctrl + c − terminate the current command.
- ctrl + c twice − terminate the Node REPL.
- ctrl + d − terminate the Node REPL.
- Up/Down Keys − see command history and modify previous commands.
- tab Keys − list of current commands.
- .help − list of all commands.
- .break − exit from multiline expression.
- .clear − exit from multiline expression.
- .save filename − save the current Node REPL session to a file.
- .load filename − load file content in current Node REPL session