
Through this post, I wish to answer the following questions. In some way, this will be an extrapolation of our understanding of the building blocks of Node.js to establish certain ground rules and guidelines for creating a rock solid foundation for our projects. These constitute the various facets of creating a robust application in terms of the overall architecture, the folder structure, modularity, writing clean code, managing dependencies and so much more. The second half of this post will be dedicated to the other end of the spectrum - highlighting 12 best practices to keep in mind when starting with a new Node.js project. We will explore this in greater depth in the first half of this post. An integral aspect of how Node.js works under the hood is it’s single threaded, event loop based apparatus for achieving asynchronous behaviour. Over time, these lower-level insights and knowledge reflect in the way we write code and drive our understanding of how we can optimize our applications for speed and performance.

In this post, I want to talk about two aspects of programming in Node.js - about the internal mechanics of the framework and about the best development practices for creating efficient and sustainable Node.js applications.īy consciously making the effort to understand the inner workings of a framework, we open ourselves to insights about the ways and means of not only the framework itself, but also about prevalent programming paradigms and their design decisions.

I’m a big Javascript fanboy, and thanks to Node.js, I can write Javascript code outside the browser to create server-side web applications that are non-blocking, lightweight, fast, robust and scalable. Even though only 11 years old, Node.js has emerged to be one of the most popular web development frameworks in the last decade.
