1) What is NodeJs?
2) What are the features on NodeJs?
These are the some important feature provided by NodeJs:
- Asynchronous and Event Driven.
- Fast code execution.
- Single threaded.
- No buffering
- Great concurrency
3) What is REPL in NodeJs?
REPL (Read Eval Print Loop) represent a computer environment (window console or linux/unix shell) where some command is entered and system generates an output.
- Eval: Evaluate the data structure.
- Print: Prints the output result.
- Loop: Circulate the above all commands until user press ctrl-c twice.
4) What is npm?
npm stands for Node Package Manager. It provide the following facilities:
- It provides command line utility to install NodeJs packages.
- It also manages version and dependency of NodeJs packages.
- It provides online repositories facilities for NodeJs packages which are It provides online repositories facilities for NodeJs packages which are searchable on search.nodejs.org.
5) How NodeJs works?
6) Why Node.js is single threaded?
7) Where can we use NodeJs?
NodeJs is used to build following type of applications:
- Network application
- Web application
- Single Page application
- Video (data) streaming application
- Distributed systems
8) What does event-driven programming mean?
Event driven programming is a programming paradigm in which the flow of program is determined by events. In NodeJs event driven paradigm is maintain by event
. NodeJs uses an event loop and whenever a task gets finished, it calls the corresponding event.
9) What is EventEmitter?
EventEmitter is a class which lies in events module. It has multiple methods with event and listener. The following code represents how it can be accessed:
var events = require('event'); //import event module
var eventEmitter = new events.EventEmitter(); //creating an object
Methods under EventEmitter class:
10) What are the different types of API functions in NodeJs?
There are two types of API function in NodeJs:
- Non-blocking (asynchronous) function.
- Blocking (synchronous) function.
11) What is 'Callback' in NodeJs?
Callback is a function used to deal with multiple requests made to the server. A callback is called at the completion of assign task. Callback function allows server to deal with pending request first and call a function when it is completed.
12) What does it mean "non-blocking" in NodeJs?
Non-blocking code are those which doesn't wait for previous assign task to complete. Non-blocking code means that the IO is not blocking. Non-blocking code do not execute in sequence.
13) What is "blocking" function in NodeJs?
Blocking code refers when an application wait for some I/O operation in order to complete its execution. It wait for previous assign task to complete first when multiple task assign to server.
14) Which command is used to import external libraries?
"require" command is used to import external libraries.
var http=require("http"); //load http library.
var fs=require("fs"); // load external file.
15) Which is the most compatible framework used in NodeJs?
"ExpressJs" is most commonly framework used in node.js.