Node.js
Node.js is a server side platform built on Google Chrome's JavaScript Engine (V8 Engine). Node.js was developed by Ryan Dahl in 2009. The definition of the Node.js as supplied by the official Node.js documentation is as follows -
"Node.js is a platform built on Chrome's JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices."
Node.js is open source, cross platform runtime environment for developing server-side applications. Node.js applications are written in JavaScript. Because of the arrival of Node.js, way of the web developing was completely changed. Early days, most of web applications had used PHP for their server-side. Therefore, one must know javascript and php for become a full stack developer. Now, front-end developer do not need to know other server-side programming languages to become a full stack developer because of the Node.js.
Nowadays, JavaScript is playing major role in the industry, and people who are expert in JavaScript, will get demand. Since Node.js is using asynchronous programming, it is extremely fast and lightweight. Following things are the features of Node.js -
- Asynchronous and event-driven
- Extremely fast
- Single threaded but highly scalable
- No buffering
- License
- I/O bound applications
- Data streaming applications
- Data intensive and real time applications
- JSON APIs based applications
- Single page applications
Note:- Node.js is not advisable to use in CPU intensive applications.
See 10 global companies that using Node.js for their server-side applications:- https://www.tothenew.com/blog/how-are-10-global-companies-using-node-js-in-production/#
Node Package Manager (npm)
When we are talking about Node.js, we should definitely check out npm. The npm is node package manager, it comes with Node.js and it is the world's largest software registry. It contains over 800,000 code packages. It totally free to use.
By default, all the dependency modules will get installed on 'node_modules' directory. 'package.json' file contains all meta and dependency information. We can create 'package.json' file from typing 'npm init' on your command line. Then it will ask series of questions, after that file will be created. When we have the package.json file and we want to install the dependencies that our application need, just simply type 'npm install' in your cmd, then rest will handle by the npm. Please note that, you have to install npm for work these commands. npm comes with Node.js. By installing Node.js, you can use npm.
If we want to install specific module, you have to type 'npm install [module-name]'. As a example, if you want to install react-dom, then you have to type 'npm install react-dom'. Put '--save' to save the dependency name on the package.json. Ex:- 'npm install --save react-dom'.
Comments
Post a Comment