Please enable Javascript to correctly display the contents on Dot Net Tricks!

Exploring REPL Terminal

  Author : Shailendra Chauhan
Posted On : 31 Dec 2015
Total Views : 2,799   

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.

Free Interview Books
14 OCT
Angular2 and Angular4 (Online)
03:00 PM-05:00 PM IST (+5.30GMT)
12 OCT
ASP.NET Core (Online)
09:00 PM - 11:00 PM IST(+5:30 GMT)
10 OCT
Microsoft Azure Infrastructure Solutions (Online)
08:00 AM-09:30 AM IST / 09:30 PM -11:00 PM CST
30 SEP
Angular2 and Angular4 (Classroom)
08:30 AM-11:30 AM IST
20 SEP
MEAN Stack (Online)
07:00 AM-09:00 AM IST
20 SEP
ASP.NET MVC with Angular4 (Online)
9:00PM- 11:00PM IST(+5:30GMT)
16 SEP
Angular2 and Angular4 (Online)
08:00 AM-10:00 AM IST(+5.30 GMT)
22 AUG
ASP.NET Core with Angular4 (Online)
07:00 AM - 9:00 AM IST(+5:30 GMT)