Node Introduction

You are very familiar with Javascript by now, and you may notice that we can only run Javascript in our browser using the <script> tag. What if we want to write scripts using Javascript and run them using the local machines, just like how python is.

This is where Node comes into play. It is a JavaScript runtime engine built on Chrome's V8 Javascript engine that allows you to run JavaScript even without a browser. This means that you are able to do a lot more with JavaScript: managing local files, connecting and setting up a server, and much more.

Learning Outcome

  1. How npm & node works
  2. Create Backend APIs using Node & Express
  3. How to make API calls using axios

Getting Started

mkdir example
cd example

NPM

With the ability to run JavaScript locally on our machine (with the help of Node) and the contribution of a rich number of packages from a large community, the possibilities for JavaScript are endless!

To manage many of the packages that give Node its most powerful abilities, we use NPM. Node package manager (NPM) is a place where you can find and download node packages.

npm

Installing Node

Go to https://nodejs.org/en/ to install node.js for free.

Let us confirm that you have correctly downloaded Node.js and npm.

In the terminal, type

node -v
npm -v

If both lines output the version number then we are good.