python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 7, Interview Questions Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
Creator of node.js

Node.js - REPL Terminal - Read Eval Print Loop

What is REPL?

The REPL stand for “Read Eval Print Loop” and The REPL module provides a “Read-Eval-Print-Loop” implementation.

                    I.            Read – Read user inputs.
                  II.            Eval – Evaluates the data structure.
                III.            Print – Print the result.
                IV.            Loop - Loops the above command until the user multiple presses.

It is also represents a computer environment likes,
                    I.            A Windows Console,
                  II.            UNIX and
                III.            Linux etc.

In Node.js, The REPL is use for JavaScript code debugging and also for experimenting etc.

It is also available for standalone or other accessible programs.

Node.js itself uses the REPL module to provide its own interactive interface for executing JavaScript and it can use by executing the Node.js binary without passing any arguments.

It is using looks like, const repl = require ('repl');

The REPL module exports from the “repl.REPLServer” class and the Instances of “repl.REPLServer” is automatically supported to,
                    I.            Completion of inputs,
                  II.            Simplistic Emacs style line editing,
                III.            Multi line inputs and
                IV.            ANSI styled output etc.

By default, all instances of “repl.REPLServer” are using an evaluation function that are evaluates JavaScript expressions and provides access to “Node.js” built in modules.

The special keys and commands are supported by REPL,

                    I.            .break – This command is use to exit from multiline expressions.
                  II.            .clear – This command is use to reset the REPL context.
                III.            .exit – This command is use to close the I/O stream.
                IV.            .help – This command is use to display the list of special commands.
                  V.            .save – This command is use to save the current REPL session.
                VI.            .load – This command is use to load a file into the current REPL session.
              VII.            .editor - This command is use to allow editor mode.
            VIII.            Ctrl + c − This command is use to terminate the current command.
                IX.            Ctrl + c twice − This command is use to terminate the Node REPL.
                  X.            Ctrl + d − terminate the Node REPL.

I hope this information will be helpful! Thank you!


Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions