Modern Web Development Using Node.js

Sandip Das
Mar 23 · 7 min read

What is Node.js?

“Node.js® is a JavaScript runtime built on Chrome’s V8 JavaScript engine.”

“Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser” — Wikipedia

All above just simply means that you can run your javascript code in server machine (any os) using node.js.

Why Node.js so popular?

  • Node.js has an event-driven architecture capable of asynchronous / non-blocking I/O
  • Node.js aim to optimize throughput and scalability in web applications with many input/output operations, as well as for real-time Web applications.
  • Node.js package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
  • It’s great to work in “JavaScript Everywhere” approach, in front-end as well as back-end having consistency of using same language is just awesome as it sounds.
  • Node.js have proven benchmark for being fast and high performance against the current competitors.
  • Node.js can be hosted anywhere, be it AWS, GCP, Azure, Heroku and many others.
  • If Node.js developers follow particular framework or particular structure then code readability is good just like any other top programming languages.
  • Huge community support is the true blessing

What are the best use case of Node.js?

  • Real time web applications
  • Back-end Specific Applications (used to interact with different databases and cache ), REST / GraphQL Api
  • Blogs, CMS, Social Applications.
  • Robotics — IoT Devices programming (including handling communication with server)
  • Stand Alone Script — e.g. as CRON scripts or just one time execution scripts

There is a lot more use cases but above are the primary use cases

Detailed survey on use of node.js: (must check)

What about Limitations ?

  • Node.js is a great solution for building simple, mid-complex or highly complex projects. But, it is not the ideal option when you need to deal with CPU-intensive tasks. Due to incoming request blockage by heavy computations, there is a significant loss in performance. On that account, it is not a fit for long-running calculations.
  • Callback hell — This issue can affect the quality of your javascript code and trigger other declines such as development slowdowns and cost increases. Callback hell is a situation caused by execution of multiple asynchronous operations where myriad nested callbacks end up a callback function

How to start node.js development?

I would highly suggest first get familiar with core node.js modules like path, http, url, querystring, fs, util etc. Click here to see full list of core modules.

After that you might be interested in express.js if you want to develop web applications, if you are looking for better frameworks then you can check: Sails.js, Happy.js, Koa.js, Nest.js,, Meteor.js,, Strapi etc.

If you want to make real-time websocket based application you may want to use:, basic websocket

In below article I have given reference for good javascript resources as well as node.js courses links as well:

What you need to learn more in sense of long term career in Node.js development ?

First of all you will need to know at least one popular regular database like MongoDb, MySql, PostgreSql etc.

To integrate database use:

MongoDB: Mongoose.js ODM

SQL/PostgreSQL : Sequelizejs ORM

For other database don’t worry if it’s really a well known database you will find the client module in npm.

Learn about scaling applications, clustersing, worker process , forking etc

Just read this detailed post:

You will also need to know node.js process events. Atleast read about “uncaughtException” , “unhandledRejection”, “message” , “process.env”, “exit” ,”process.argv”.

Use PM2 or Forever.js to run production applications.

PM2 is suggested by more senior programmers, here’s the detailed post how can you use PM2 to run production level node.js application:

Also using PM2 handling cluster logics are very easy:

However if you like to use Forever.js, follow below simple article:

But to handle reboot scenarios using forever.js I personally will suggest use forever.js service module:

Also Learn About:


It’s my most favourite feature, specially architected to eliminate the callback hell issue.

Officially Node.js v8.x onwards async/await is available natively in node.js, before async / await , I was using async npm module to handle callback hell issue.

Let’s see how this async/await looks:

Let’s see how code looks without async/await:

You should start thinking about using async/await if you are already not using it.

Read below two articles to understand async/await very well:



After you actually used to async/await you will have better understanding of where to use it and where to not use, that’s the most important part.

Stable HTTP/2:

In Node v8 an experimental HTTP/2 module was introduced, but it was bit buggy, now in Node v10 HTTP/2 much stable.

What You can achieve using HTTP/2:

  • Server Push (my favourite)
  • Prioritization
  • Header Compression
  • Multiplexing

A detailed article on HTTP/2 you can read on:


“A promise represents the eventual result of an asynchronous operation. It is a placeholder into which the successful result value or reason for failure will materialize.”

Here is simplified explanation:

Here is very detailed in-action explanation of promises in node.js:

Error handling:

No matter if you are experience or fresher, expected or unexpected error will occur no matter what, always handle errors and error logging.

Different Types of error handling:

  • Error object
  • Try…catch
  • Throw
  • Call stack
  • Effective function naming
  • Asynchronous paradigms like promise

To read in more depth about this errors, refer to:

Learn more on logging libraries like :

  • Node-Loggly
  • Bunyan
  • Winston
  • Morgan

Read this full article:

I personally like this article about Winston:

Write Tests Cases:

Don’t forget to write test cases, in long run it will save a lot time plus ensure your code quality.

Use famous test runners like Mocha, Chai, Jest. If you have time please read:

I liked writing test Jest, here’s a very good article:

Secure your node.js Application:

With growing popularity, attacks on node.js application increases, and that’s not just from outside, from inside as well (read:

This topic is so big and being the person who faced issues in production due to security, I can write a lot about it , it’s itself a big topic, may be I will write my past experiences about it later in some other post, but for now, read below two post to make sure your application is secured from known threats:

Finally I will suggest check: , there you will get to know about most useful node.js modules and other node.js related sources, it’s always get updated and I check weekly.

Use ESLint:

For better productivity, quality code writing consider using ESLint plugin. It’s works excellent with both Atom and VSCode.

Setting up ESLint in VSCode:

Setting up ESLint in Atom:

Thanks for reading!

If you like this post don’t forget to like and share with others, also if you are already using node.js, let everyone know in comment what features you like most about node.js, which node.js packages you like most, or what use case you have observed that can help others, share your knowledge with others.

I have decided that after my AWS Certification exams are over then I will start writing weekly articles on node.js, node.js use cases with different AWS services and on different javascript related subjects.

Past Node.js related articles:

About the Author

Sandip Das is a tech start-up adviser, mentor to young development professionals as well as working for multiple international IT firms , tech-entrepreneurs as Individual IT consultant / Sr. Web Application developer/ Cloud Solution Architect / JavaScript Architect, worked as a team member, helped in development and in making IT decision . His desire is to help both the tech-entrepreneurs & team to help build awesome web based products, make team more knowledgeable, add new Ideas to give WOW expression in product.

More on Sandip here at LinkedIn

Keywords: #nodejs #javascript #webdevelopment

Sandip Das

Written by

Senior Full Stack JavaScript Developer | Cloud Application Architect + Developer (4x AWS Certified) | Tech Advisor

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade