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 IO model,
which makes it very efficient to run JavaScript programs
on the desktop and synchronous JavaScript on the desktop.
Now, this is where node finds its true power.
Right now, we will examine Node.js in the context of its use as a JavaScript runtime.
They will look at the server-side application of
Node.js in detail in the last course of this specialization.
This is the typical architecture of Node.js.
So in this, that 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 is 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.
We will explore some of these in the later part of this course and in subsequent courses.
The last course in the 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 on the server-side.
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 consist 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.