Node.js, often simply referred to as Node, is an open-source, cross-platform JavaScript runtime environment that since its inception in 2009 has taken the world of web development, by storm. Today, it’s considered the most commonly used web technology, according to Stack Overflow’s Developer Survey 2023 (later SODS-2023).
In this article, we will explore the main uses of Node.js and what types of applications benefit from it the most along the way observing the examples and advantages of Node.js where appropriate.
Web applications
Since the beginning one of the main roles of Node.js was the creation of web applications.
What is a web application?
Let’s say you want to build a website that has a ton of different pages that all have to be exposed to search engines, for example, a blogging website or an online store. This is the exact situation where web applications are used. They work by populating requested HTML pages with needed data on the server before giving them to the client. The main advantage of this approach is that it eliminates the need to manage individual HTML files, which becomes troublesome when their amount is considerable.
Node.js revolution
Previously this was done by technologies written on PHP, or Python, the most famous examples are WordPress and Drupal applications. But with the advent of such frameworks as Next.js and Nuxt.js built on top of Node.js today, we see an emergence of the 2nd generation of web applications.
Advantages of Node.js web apps
The main advantage of applications built with Node.js over traditional ones is the use of what is called SPAs, or Single Page Applications. They allowed to improve user experience by eliminating browser refreshes in page navigations and drastically enhanced overall performance by reusing parts of contents between pages. According to SODS-2023 Next.js alone has grown two times in popularity for the last year, and went from 11th position in 2022 to 6th in 2023 among the most used technologies on the web. Overall what’s happening right now could be called a revolution of Node.js web applications.
Most commonly used in domains:
- E-commerce and online marketplaces
- Travel and hospitality
Most commonly associated technologies:
- Next.js, Nuxt.js, Angular Universal
Some known websites that use Node.js web applications:
- Twitch, Netflix, LinkedIn, Nike
API servers
Node.js is a very popular choice for building different varieties of server applications. Its speed and great scalability give it an edge in the world of traditional RESTful API servers, that focus on processing data and making calls to a database.
Real-time applications
Also among the common uses of Node.js are real-time applications that require instant data updates and low latency, like chats, dashboards, and live notifications.
Micro-service and serverless
Aside from that due to the overall popularity of JavaScript language and the lightweight and modular nature of Node.js, it’s also often seen in micro-service architecture and serverless computing. For example, it can be found among the most commonly used runtimes in AWS Lambda and Azure Functions.
Architecture and some caveats
However, the nature of Node.js does not allow it to be ideal everywhere and sometimes it’s much better to apply a different technology. More on Node.js architecture, API, and drawbacks will be discussed in the article “Why Node.js is one of the best choices for API server (with some caveats)”.
Most common uses:
- RESTful API, real-time applications, micro-services, serverless
Most commonly associated technologies:
- Express.js, Koa, Nest.js, Websocket
Some known websites that use Node.js API servers:
- NASA, PayPal, LinkedIn, Uber
Desktop Applications
Not many people know, but actually, most of the modern desktop applications are built with Node.js using Electron framework.
Pros and cons
The advantages of using it are that such applications are cross-platform, written in JavaScript, HTML, and CSS, which allows to employ frontend developers into the task and they open to a rich world of libraries from npm registry. There are some disadvantages however, like big bundle size and lack of some very specific functionality, but by reading the list of known applications employing it you will anyway get the idea how indeed powerful it is.
Some known websites that use Node.js desktop applications:
- Slack, WhatsApp, Visual Studio Code, Skype, Discord, Zoom, Microsoft Teams
Conclusion
In conclusion, over the past 15 years, Node.js has transcended its initial role as a JavaScript runtime environment to become a linchpin in the development of robust web applications, API servers, and even cross-platform desktop applications. Its continued evolution and integration into diverse technological landscapes underscore its enduring significance in the ever-changing world of web development.
Thanks for reading.