Category: Node JS Interview Question and Answer
-
What is the difference between operational and programmer errors?
Operational errors are not bugs, but create problems with the system like request timeout or hardware failure. On the other hand, programmer errors are actual bugs.
-
What tools can be used to assure a consistent style in Node.js?
Following is a list of tools that can be used in developing code in teams, to enforce a given style guide and to catch common errors using static analysis.
-
What is npm? What is the main functionality of npm?
npm stands for Node Package Manager. Following are the two main functionalities of npm:
-
Does Node.js supports cryptography?
Yes, Node.js Crypto module supports cryptography. It provides cryptographic functionality that includes a set of wrappers for open SSL’s hash HMAC, cipher, decipher, sign and verify functions. For example:
-
What is the use of the underscore variable in REPL?
In REPL, the underscore variable is used to get the last result.
-
Is it possible to evaluate simple expressions using Node REPL?
Yes. You can evaluate simple expressions using Node REPL.
-
Explain the tasks of terms used in Node REPL.
Following are the terms used in REPL with their defined tasks: Read: It reads user’s input; parse the input into JavaScript data-structure and stores in memory. Eval: It takes and evaluates the data structure. Print: It is used to print the result. Loop: It loops the above command until user press ctrl-c twice to terminate.
-
What is REPL in Node.js?
REPL stands for Read Eval Print Loop. It specifies a computer environment like a window console or Unix/Linux shell where you can enter a command, and the computer responds with an output. It is very useful in writing and debugging the codes. REPL environment incorporates Node.js. See the Example: