Node. js REPL (Interactive interpreter) instance details, node. jsrepl
Node. js REPL (Interactive Interpreter)
Node. js REPL (Read Eval Print Loop: Interactive interpreter) indicates a computer environment. Similar to the terminal of the Window system, we can enter commands in the terminal and receive system responses.
Node comes with an interactive interpreter that can execute the following tasks:
- Read-read user input, parse the input Javascript data structure, and store it in memory.
- Execute-execute the input data structure
- Print-output result
- Loop-perform the preceding steps until you press ctrl-c twice to exit.
Multi-line expression
Underscore (_) Variable
You can use the underscore (_) to obtain the operation result of the expression:
REPL command
- Ctrl + c-exit the current terminal.
- Ctrl + c press twice-exit Node REPL.
- Ctrl + d-exit Node REPL.
- Up/down key-view input History commands
- Tab key-list the current command
- . Help-LIST commands used
- . Break-exit multi-line expression
- . Clear-exit multi-line expression
- . Save filename-save the current Node REPL session to the specified file
- . Load filename-load the file content of the current Node REPL session.