Nest.JS over Others

Luvdeep Katyal
3 min readAug 21, 2022
Nest.JS

If you work on Node.JS you must be aware that there are several frameworks that you can use and that leads to a common confusion that which framework one should choose and procced upon

Now bringing out the elephant in the room, we would below discuss about Nest.JS and it’s rival frameworks

To begin with the basic question of “What actually is Nest.JS ?”

Nest.JS is one of the fastest growing framework for Node.JS,

It is open-source, extensible, versatile and progressive for building efficient, scalable server-side applications, being progressive here refers to bring JS features and design patterns into the Node

So, it uses progressive JavaScript and fully supports TypeScript and is also a combination of the following three :

1. OOP (Object Oriented Programming)
2. FP (Functional Programming)
3. FRP (Functional Reactive Programming),

which is not usually found in other frameworks,

Programming

Nest makes use of robust HTTP Server frameworks like Express because express is widely-used, well-known, and has an enormous set of compatible middleware, which is available to Nest users out-of-the-box and also Nest optionally can be configured to use Fastify as well, but Nest provides a level of abstraction above these common Node.js frameworks making it advantageous over the available frameworks.

It also exposes their APIs directly to the developer. This provides the freedom to use the vast number of third-party modules which are available for the platform.

Angular

The architecture of Nest, is actually inspired by Angular, the module, service, controller, pipe, decorators are more syntactical to Angular

Features over other frameworks:

Key features like,

  • Typescript compatibility
  • Powerful CLI
  • Built in support for micro-services
  • Ready dev-ops support
  • Built in exception filter
  • Framework compatibility
  • Better database interaction
  • Default nested routing (which is not used by other frameworks like Hapi)
  • Easy unit testing

    makes Nest preferable over other frameworks.

Framework Independence:

One of the core feature of nest that differentiates it with other frameworks is that Nest gets framework independence by implementing a framework adapter whose primary function is to proxy middleware and handlers to appropriate library-specific implementations.

Node.Js and it’s common frameworks

Performance:

Since Nest.JS integrates with Node.JS and modules like Express and Fastify, it can multiply the productivity and application performance while reducing time.

It enables database connectivity through APIs and data caching to reduce the payload.

Nest.JS provides an architecture known as the Controllers-Providers-Modules that enables to create applications that are easier to test and maintain.

Ensuring the application is scalable, highly testable, and loosely coupled contrary to other Node.js frameworks like Express or Koa where regarding the architecture may cost lots in terms of time spent refactoring the codebase later

Summary:

Better than other Frameworks, Nest.JS provides a large boost right at the very starting along with it’s easier installation and understanding while helping developers take their next steps by defining proper architecture.

References:
https://docs.nestjs.com/

--

--