Read Eval Print Loop (REPL) in nodeJS
Introduction
- The repl module provides a Read-Eval-Print-Loop (REPL) implementation that is available both as a standalone program or includible in other applications
- The repl module exports the repl.REPLServer class
- Accept individual lines of user input
- Evaluate those according to a user-defined evaluation function, then output the result
- Input and output may be from stdin and stdout, respectively, or may be connected to any Node.js stream
How to run
- Open terminal and type node
- This will take you repl mode
> 1 + 1 2 > const x = 2 undefined > x + 1 3