What is NODE.JS

What is NODE.JS?

  • NodeJS is a javascript runtime, its not a language or framework
  • It is built on V8 javascript engine same as google chrome
  • It is written in C++
  • It allows you to run javascipt code on the server

Why should you use NODE?

  • It’s extremely fast, efficient and scalable
  • It uses event driven, non-blocking Input output model
  • You can use same language for both frontend and backend (javascript), used along with frontend frameworks such as react or angular
  • It’s popular in the industry

Non Blocking I/O

  • It works on single thread using non blocking I/O calls
  • It works in asynchronous way, you don’t need to wait from the request to complete before processing the next request
  • It supports tens or thousands concurrent connections with event loops, don’t use NODE for CPU intensive apps or long running calculations
  • Optimizes throughput and scalability in applications with many I/O operations
  • All of these features makes NODE.JS applications very fast and efficient

NPM – Node package manager

  • It is used to install third party packages – such as libraries, tools, frameworks etc.
  • These packages are stored in node_modules folder
  • Dependencies are stored in packages.json file
  • npm scripts can be created to do certain tasks such as run server, compile files etc.

Below is the list of commands used to install NPM

npm init //generates a packages.json file
npm install packagename //install package locally
npm install -g nodemon //install package globally

NODE code modules – path, fs, http etc

You can install Node.js here and start building your applications.