REPL Terminal in Node.js

REPL stands for Read Eval Print Loop an 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.

  • Read - Read user's input, parse the input innto Javascript data-structure and store in memory.
  • Eval - Takes and evaluates the data structure.
  • Print - Prints the result.
  • Loop - Loops the above command until the user presses Ctrl + C twice.

The REPL feature of Node is very useful in experimenting with Node.js codes and to debug Javascript codes.

No comments:

Post a Comment

Labels