Introduction to Node.js
Hello! I hope you had
a good day and an awesome week. 😊
In this post, I’ll give a brief introduction to Node.js
which is currently in trend.
First of all, what is node.js? Node.js is an open source,
cross platform run-time environment for server-side and networking applications.
It was developed by Ryan Dahl. It is built on V8 engine which the JavaScript
engine of Google Chrome. Its initial release was supported only Mac OSX and
Linux.
Listed below are some features of Node.js which makes it a
better choice for web development,
- Non-blocking I/O(input/output) - Node.js operates on non-blocking I/O model, which means, the main thread (as node.js is single threaded) will not wait for I/O operations to get complete, instead it will continue to execute after calling an API.
- Asynchronous - Node.js is asynchronous because of its non-blocking I/O nature. This happens because of the main thread not waiting for the completion of I/O operations.
- Event-Driven - Node.js has a notification mechanism of events which helps the server to get a response from a previously called API. This is what basically manage the asynchronous operations.
Next, let’s see some of the advantages of Node.js,
- Ideal for data-intensive, real-time applications that run across distributed devices.
- Ability to use one programming language from front end to the back end of the application (full stack development).
- High performance due to caching of modules into memory after the first use.
- Easiness to scale both horizontally and vertically.
- Easily extensible (a style of computer programming that focuses on mechanisms to extend the programming language, compiler and run-time environment).
Node.js has some disadvantages as
well. Listed below are few,
- Not ideal for computationally/CPU intensive tasks.
- Although number of libraries are available, only few of them are robust (ability to cope with errors during execution and cope with erroneous input).
- Asynchronous programming is complex than synchronous programming.
Node.js is best for applications which can categorized as
one of the following,
- I/O Bound Applications
- Data Streaming Applications
- Data Intensive Real-time Applications
- JSON API Based Applications
- Single Page Applications
Node Package Manager (npm)
Node package manager comprises of two things,
- An online repository for the publishing of open-source Node.js projects.
- A command-line utility for interacting with the said repository that aids in package installation, version management and dependency management.
So, I hope you must
have at least a slight idea about Node.js now.
Further, listed below is some popular applications which was
built using Node.js,
- PayPal
- eBay
- Uber
- Netflix
In the next post, let’s
do some coding. I wish you all an amazing week ahead. Adios 😊

Comments
Post a Comment