What is NODE.JS?
- 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
- 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.