I am currently working on a Nest js project for a large enterprise company. Before using Nest I used Java for all of my web services. After experiencing Nest, I feel that it is superior to my old Java ways and want to share my reasons why. By the end of this article, you will have a 10,000-foot view of what Nest js is and if it is right for your next project. Let's get started:
Nest was developed by Kamil Myśliwiec and was designed as a framework to rapidly build server-side applications. Myśliwiec was heavily inspired by Angular and it shows in the structure of a Nest application. The Angular inspiration can be seen with its use of controllers, providers, modules, and pipes. All of these fit into a folder structure that looks similar to how an Angular application would look.
Pro’s of Nest
The folder structure in Nest is heavily based on Angular. This allows for minimal downtime when first designing a Nest service. Components get their own folders, with an application module and main file residing in the root(plus some extra configuration files). This structure is as simple as it sounds and allows more attention to be paid to the design of endpoints and their consumers, instead of application structure.
Similar to Angular, Nest also has a decent command line tool, available through Node Package Manager, nestjs/cli. The command line tool will let you scaffold the project, generate Nest architecture components, and display project information. The documentation for that can be found here.
Con’s of Nest
The largest risk facing Nest users is the lack of documentation. The framework has great integrations with other frameworks but the documentation is minimal and doesn’t cover any issues that may arise. Admittedly the issues tend to be few and far between due to the simplified structure but when an issue does occur finding stack overflow help can be tricky.
Another concern, albeit a minor concern, is the question of longevity. Nest receives a good amount of weekly downloads but there are several other server-side framework competitors out there. Nest does hold an edge in its use of TypeScript and relation to Angular but it doesn’t have the backing power of an IBM or large enterprise behind it. Based on the Nest website it seems that its biggest user is Adidas, although other larger companies, that aren’t listed on its homepage, might be using Nest. This is a minor con but when choosing any framework its something that should be considered.
Currently, Nestjs/core is getting about 74,000 downloads a week on npm. If you’ve read through this article I’d encourage you to go out and download a few of the Nest modules and try them out.