Exploring REPL Terminal

12 Sep 2022

REPL stands for Read-Eval-Print-Loop. It is an interface to run your JavaScript code and see the results. You can access REPL by simply runningNode.js command prompt and simply run command node.

Here, we are adding two numbers 1 and 2 which results into 3.

REPL Commands

It shows REPL options and commands.
It helps you to exit from multiline expression when you get stuck.
It is an alias for .break.
Exit the REPL
It will help you to load JS code form a file into the REPL session.
It will save all evaluated command in the REPL session.

REPL Shortcuts

Ctl + d
It will terminate the REPL session.
Up/Down Keys
It will iterate through command history.
It will display the list of current available commands.
What do you think?

I hope you will enjoy commands and short-cuts while programming with Node.js. I would like to have feedback from my blog readers. Your valuable feedback, question, or comments about this article are always welcome.

Learn to Crack Your Technical Interview

Accept cookies & close this