Vaidikalaya

Node.js Introduction


Node.js is an open-source, single-threaded, cross-platform JavaScript runtime environment for developing server-side and networking applications.

Node.js was developed by Ryan Dahl in 2009 and It was built on Google Chrome's V8 JavaScript engine.

Node.js applications are written in JavaScript and can be run within the Node.js runtime on OS X, Microsoft Windows, and Linux.

Node.js also provides a rich library of various JavaScript modules which simplifies the development of web applications using Node.js to a great extent.


Features of Node.js

⮞ Open-source:

This means that the source code for Node.js is publicly available. And it's maintained by contributors from all over the world. The Node.js contribution guide shows you how to contribute.


⮞ Cross-platform:

Node.js is not dependent on any operating system software. It can work on Linux, macOS, or Windows.


⮞ JavaScript runtime environment:

A runtime environment is an environment where your code or program will be executed. It determines what global objects your program can access and it can also impact how it runs. The most common place where JavaScript code is executed is in a browser so browsers is the runtime environment for JavaScript code can run in NodeJS so NodeJS is one of the JavaScript runtime environments.


⮞ Single Threaded:

Nodejs uses “Single Threaded Event Loop Model” architecture to handle multiple concurrent clients.


⮞ Asynchronous and Event Driven:

All APIs of the Node.js library are asynchronous, that is, non-blocking. It essentially means a NodeJs-based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call.


⮞ Very Fast:

Node uses the V8 JavaScript Runtime engine, the one which is used by Google Chrome. Node has a wrapper over the JavaScript engine which makes the runtime engine much faster and hence the processing of requests within Node also becomes faster.


⮞ No Buffering:

Node.js applications never buffer any data. These applications simply output the data in chunks.


⮞ Active Community:

There is an active and vibrant community for the Node.js framework. Because of the active community, there are always key updates made available to the framework. This helps to keep the framework always up-to-date with the latest trends in web development.


Who uses Node.js

Node.js is used by many large companies. Below is a list of a few of them.
⯌ Netflix
⯌ NASA
⯌ Trello
⯌ PayPal
⯌ LinkedIn
⯌ Walmart
⯌ Uber
⯌ Twitter
⯌ GoDaddy.


Where to use Node.js?

⯌ Data Streaming Applications.
⯌ Single Page Applications
⯌ Chat Applications.
⯌ Game Servers.
⯌ JSON-based Applications


Where not to use Node.js

Node.js can be used for a lot of applications with various purposes. The only scenario where it should not be used is where there are long processing times, which is required by the application.
Node is structured to be single-threaded. If an application is required to carry out some long-running calculations in the background, it won’t be able to process any other requests. As discussed above, Node.js is used best where processing needs less dedicated CPU time.