JavaScript which was designed as
a scripting language for the browser has seen deployment far beyond the browser.
Node.js has played a significant role in
this shift of JavaScript from the browser to the desktop.
Let's now learn a little bit about what Node.js is and what role does NPM,
the Node Package Manager play in the context of Node.js.
Node.js as I mentioned earlier,
allows us to bring the power of JavaScript to the desktop.
Node.js is based on
the JavaScript runtime engine that has been built for the Chrome browser.
So, the Chrome V8 JavaScript Engine has been ported from the browser to
run on the desktop and support the execution of JavaScript programs on the desktop.
Node.js is built around an event-driven,
non-blocking I/O model which makes it very efficient to run
JavaScript programs on the desktop asynchronous JavaScript on the desktop.
Now, this is where node finds its true pouch.
This is the typical architecture of Node.js.
So, in this, the Chrome V8 engine is at the bottom layer together with libuv,
forms the layer that interacts with
the underlying computer system to support the execution of JavaScript programs.
On top of it, we have node bindings which will also implemented in C++.
At the top layer,
you have the Node.js and Standard Library which are all implemented in JavaScript,
and this is what enables us to write JavaScript programs and run them on the desktop.
Naturally, the ability to run JavaScript programs on the desktop energize
the web development community to explore using
JavaScript to develop a significant number of web development tools.
Tools such as Bower, Grunt,
Gulp, Yeoman, and many others.
This course in this specialization as I mentioned
looks at the use of Node.js on the server side,
how we can develop web server business logic all implemented in JavaScript.
Together with node, you often hear people talking about the Node Package Manager or NPM.
When you install Node on your computer,
NPM automatically gets installed.
The Node Package Manager is the manager for the Node ecosystem that
manages all the Node modules and packages that have been
made publicly available by many different users.
A typical Node package consists of JavaScript files together with a file
called package.json which is the manifest file for this node module.
We will look at how we can use the
package.json file in more detail in the subsequent exercises.