Most programming tasks are typical. If we're not talking about a specific business case, most likely all possible tasks have already been solved by other programmers (and more than once). Frameworks help us write less boilerplate code and focus on building features that are really helpful. 

The first popular web framework for Node.js was express.js. Nest.js greatly expands its functionality and helps the developer build applications using the best architectural practices. So, what is NestJS? What are its main benefits and cool features? Let’s find out. 




NestJS (Nest) is a framework for building efficient, scalable Node.js applications on the server. It uses modern JavaScript and is built on top of TypeScript. At the same time, it allows developers to write in pure JavaScript and combines elements of OOP (object-oriented programming), FP (functional programming) and FRP (functional reactive programming). 


Under the hood, Nest uses robust HTTP server frameworks like Express (by default) and can be configured to use Fastify. 

Nest provides an abstraction layer over these common Node.js frameworks (Express/Fastify), but also exposes their API directly to the developer. This gives you the freedom to use the vast number of third-party modules that are available for the underlying platform. 




NestJS is a JavaScript framework of choice for most backend developers. Being similar to Angular.js in many ways, it takes scalable Node.js servers to a whole new level. These are the main reasons backend developers love NestJS: 


  1. Easy to use, learn and master; 
  2. Powerful command line interface increasing productivity and simplifying development; 
  3. Detailed and debugged documentation; 
  4. Open source; 
  5. Simple unit testing apps; 
  6. Built for monoliths and microservices. 




NestJS, a progressive Node.js framework for building enterprise server applications, has a lot of cool features. Let’s focus on some of them.  


Injection scopes 


Previously, each provider was shared across multiple requests. Using singletons reduces memory consumption and improves application performance. 


However, in some cases an additional life cycle control of each provider might be a necessity. For example, when implementing a separate cache for each request in a GraphQL application during multi-user systems building. To solve these problems, the IoC container now has another level of refinement allowing to create new injection scopes – Transient Scope and Request Scope. 




Nest is platform independent. It allows developers to create logical blocks that can be reused in different types of applications. With Nest, you can easily create a web application, a console utility, a job queue, or just about anything. Just install what you need for your application. 




Traditionally, each microservices communication channel was based on the request/response paradigm. This interaction mechanics was great for messaging between multiple external services. After seeing the confirmation, you could be sure that the service received the message. 

However, for some systems, bidirectional channels are not needed, they will create unnecessary overhead when you just need to publish an event (without requesting any response). This is when event-based messaging comes in handy. This paradigm makes notifying various services with a message (for example, about a certain situation somewhere in the system), a simple and efficient process. 


GraphQL ♡ TypeScript 


One of the most common problems with GraphQL is redundancy of types. A compiler that turns SDL definitions into TypeScript interfaces (or classes) is the answer to this issue. 


Nest has the type-graphql package, allowing you to generate GraphQL files with TypeScript decorators only. There are two ways to do it, and it's up to you to decide which one is more suitable for your specific needs. Both approaches are provided in the @nestjs/graphql package. 


CLI (command-line interface) 


Nest's underlying Angular DevKit has been updated, and the command-line interface now shows tooltips. Moreover, it has added support for nest g lib, which simplifies the development when you use a single repository. 




The official Nest documentation is written entirely in Markdown, making it much easier to work with. 


Partners and community 


Angular Console (UI for Angular CLI) supports Nest, making it the premier solution for building structured, scalable Node apps in the Angular repository. 




A comprehensive structure and efficient command-line interface make Nest.JS a great framework for beginners. Now with a single command, developers can build a whole new feature. 

Nest.JS offers the module, controller, service and a testing pile to get started. Not to mention, multiple templates and boilerplates for different projects.  

As the Nest framework is entirely in TypeScript, having no backend experience, front-end developers can easily use NestJS.