All things about Node.js

what is it? what it’s used for? how to learn it? and more…

Arvin mostafaei
CodeX
4 min readApr 22, 2021

--

Photo by Scott Webb on Unsplash

A Brief About Node.js:

Node.js is an open source, cross-platform runtime environment for developing server-side and networking applications. It is one of the most popular technologies nowadays to build scalable and efficient REST API’s. Node.js applications are written in JavaScript, and can be run within the Node.js runtime on z/OS, Linux, macOS, Microsoft Windows, SmartOS, FreeBSD, OpenBSD, IBM AIX.

it allows the Node.js developers to create web servers & networking tools using JavaScript and collection of modules that handle various core functionalities.

In this article we were gonna talk about node.js.

the beginning of node.js:

Photo by Jukan Tateisi on Unsplash

Dahl created this language because he wasn’t happy the way Apache http server handles multiple concurrent connections. In fact, he criticized the way code was blocking the entire process or implying multiple execution stacks for simultaneous connections.
His urge compelled him to create a Node.js project that he demonstrated at the inaugural European JSConf on 8th November 2009. The smart utilization of Google’s V8 JavaScript engine, event loop and low-level I/O API in the project managed to win millions of hearts.

In June 2011, Microsoft and Joyent together implemented a native Windows version of Node.js. The first version was released in July 2011.
In January 2012, Dahl stepped aside & promoted the co-worker and npm creator “Isaac Schlueter” to manage the project.

How Node.js works behind the scene?

both JavaScript and Node.js are run on V8 JavaScript runtime engine. This V8 engine converts the JavaScript code into faster machine code.

V8 is the JavaScript execution engine which was initially built for Google Chrome. It was then open-sourced by Google in 2008. Written in C++, V8 compiles JavaScript source code to native machine code at runtime. As of 2016, it also includes Ignition, a bytecode interpreter.

Why should I use node.js?

if you’re a web developer you probably see that node.js is so popular between the developers, but you probably don’t know why node.js is so popular!?

there are some of the important features that make Node.js the first choice of software architects:

  • Very Fast: Being built on Google Chrome’s V8 JavaScript Engine, Node.js library is very fast in code execution.
  • Single Threaded but Highly Scalable: Node.js uses a single threaded model with event looping. Event mechanism helps the server to respond in a non-blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests. Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server.
  • Event Loop: The event loop allows node.js to perform non-blocking I/O operations despite the single-threaded feature. A transaction passing through Node traverses a cascade of callbacks. And using the ‘libuv’ library(Libuv is a C library which implements this pattern and it’s part of the Node.js core modules. You can read more about libuv here.), it handles queuing & processes the asynchronous events.
  • No Buffering: Node.js applications never buffer any data. These applications simply output the data in chunks. so users can easily view the videos or stream without interruption.
  • Lightweight and Easily Scalable: Accordingly, breaking the application logic into smaller modules, micro-services, instead of creating a single, large monolithic core, you enable better flexibility and lay the groundwork for further growth. As a result, it is much easier to add more microservices on top of the existing ones than to integrate additional features with the basic app functionality.
  • Community-Driven: Back on the topic of accessibility, you’ll realize that the most accessible software often has the largest communities. The benefit of a large community is lots of support and feedback.
  • License: Node.js is released under the MIT license.

Where to learn Node.js?

there are tons of ways to learn something, you can read a book, watch a video etc. know your way that you love to learn. here are the good resources for learning Node.JS:

Udemy:

Companies That Use Node.JS:

Photo by Floriane Vita on Unsplash

Node.js is increasingly becoming a go-to technology for multiple companies across the globe. As Node.js emphasizes concurrency, speed, and intensive data exchange along with employing push technology over web sockets, it has helped companies to build various applications such as social media apps, video and text chat engines, real-time tracking apps, online games and collaboration tools. Here are global giants who trusts NodeJs :

LinkedIn, Netflix, Uber, Trello, PayPal, NASA, eBay, Medium, Groupon, Walmart, Mozilla, GoDaddy, Yandex, Citibank, Yahoo

Conclusion

Node.js is a really good choice. It has a huge Community, it is based on javascript which is the most popular programming language in the world. What’s more important is the fact that it has extended the area of JavaScript application and can be evidently used for both frontend as well as backend servers.

--

--

Arvin mostafaei
CodeX

Hello! My name’s Arvin. I’m a developer that loves simplifying things. I love breaking down complex problems into simple, easy to understand solutions.