1) What Is Node - JS?: o o o o
1) What Is Node - JS?: o o o o
1) What Is Node - JS?: o o o o
Node.js is Server-side scripting which is used to build scalable programs. It is a web application
framework built on Google Chrome's JavaScript Engine. It runs within the Node.js runtime on
Mac OS, Windows, and Linux with no changes. This runtime facilitates you to execute a
JavaScript code on any machine outside a browser.
o Node.js is very fast because it builds on Google Chrome?s V8 JavaScript engine. Its
library is very fast in code execution.
o Node.js is single threaded but highly scalable.
o Node.js provides a facility of no buffering. Its application never buffers any data. It
outputs the data in chunks.
o Client Layer: The Client layer contains web browsers, mobile browsers or applications
which can make an HTTP request to the web server.
o Server Layer: The Server layer contains the Web server which can intercept the request
made by clients and pass them the response.
o Business Layer: The business layer contains application server which is utilized by the
web server to do required processing. This layer interacts with the data layer via
database or some external programs.
o Data Layer: The Data layer contains databases or any source of data.
}
// use the data object
});
16) What types of tasks can be done asynchronously using the event loop?
o I/O operations
o Heavy computation
o Anything requiring blocking
17) 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.
REPL environment incorporates with Node.js.
Loop: It loops the above command until user press ctrl-c twice to terminate.
undefined
>x+y
30
> var sum = _
undefined
> console.log(sum)
30
undefined
>
.digest('hex');
console.log(hash);
o ESLint
o JSCS
25) What is the difference between the global installation of dependencies and
local installation of dependencies?
o Global installation of dependencies is stored in /npm directory. While local installation
of dependencies stores in the local mode. Here local mode refers to the package
installation in node_modules directory lying in the folder where Node application is
present.
o Globally deployed packages cannot be imported using require() in Node application
directly. On the other hand, locally deployed packages are accessible via require().
o Duplex: This stream can be used for both reading and write operations.
o Transform: It is a type of duplex stream where the output computes according to input.