What is Node.js ?

Node.js was written initially by RyanDahl about thirteen years after the introduction of the first server-side JavaScript environment, Netscape’s LiveWire Pro Web. This article basically focuses on the introduction to NodeJs and its features which make it stand out from other backend frameworks.

Node is an open-source JavaScript runtime environment which was written in C, C++, and JavaScript, built on the Google V8 JavaScript engine and released in 2009. Node.js is based on an event-driven, non-blocking I/O model(discussed below).

JavaScript is known mainly for its strengths in client-side development, but Node.js is doing the exact opposite working on the server-side.

Node.js = Runtime Environment + JavaScript Library

Why Node.js ?

  • Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.
    • Blocking I/O- In the blocking method, user2 data request is not initiated until user1 data is printed to the screen.
    • Non-blocking I/O-On the other hand, using a non-blocking request, you can initiate a data request for user2 without waiting for the response to the request for user1. You can initiate both requests in parallel.
  • Being built on Google Chrome’s V8 JavaScript Engine, Node.js library is very fast in code execution.
  • Node.js is awesome for building APIs.
  • Node.js is portable. It is available on Microsoft Windows, macOS, Linux, Solaris, FreeBSD, OpenBSD, WebOS, and NonStop OS. 
  • Node.js applications never buffer any data. These applications simply output the data in chunks.
  • Node.js’ package ecosystem, npm, is the largest ecosystem of open source libraries in the world. These are libraries built by the awesome community which will solve most of your generic problems.

Why Node.Js is Better than Others

  • Node.js is equally suitable for small as well as large-scale apps.
  • In the case of Node.js, it is not necessary to have full understanding of the framework.
  • Node.Js uses JavaScript language which is same that we use for frontend, so using Node.Js increases homogeneity.
  • Node.Js is comparatively more scalable.
  • It is used widely in many countries and ahead comparatively.

Limitations of Node.js

  • Asynchronous programming could be difficult to work with but easy once understood.
    • Synchronous- Say we have 2 lines of codes Line1 followed by Line2. Synchronous means Line-2 can not start running until the Line-1 has finished executing.
    • Asynchronous-Again say we have two lines of code Line1 followed by Line2. Line-1 is a time-consuming instruction. So Line-1 starts executing its instruction in the background, allowing Line-2 to start executing without having to wait for Line-1 to finish.
  • Not great with CPU intensive apps due to its single thread but this single thread is advantageous in other cases.
  • Callbacks result in tons of nested callbacks.

That’s all I have and thanks a lot for reading. Please let me know if any corrections/suggestions. Please do share and comments if you like the post. Thanks in advance… 😉


Thanks Yash Kesharvani for helping us to grow day by day. He is expert in the backend services and loves to play around node.js.

Categories: Nodejs

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert