NestJS is it worth it?

Karolis Ščerbiakas • March 3, 2020

nestjs

Pros

The folder structure in Nest is heavily based/and inspired by Angular If you're a fan of strongly typed languages you will appreciate its built with Typescript It's fast Annotation-driven

Cons

Debugging is sometimes pain. ( Mostly because of TypeORM ). Deployment causes some downtime, so you need to account for that. Using modern tools it is hardly an issue now.

Lack of documentation. Finding stack overflow help can be tricky. If you've worked with Angular even for a little you will find a folder structure very familiar. You can split your projects features into modules and keep them separate that way. Also you get everything what comes with modules. Import/export problems too!

Nest is built with Typescript. I love how it sort of reminds me of swift. Nest is very fast. You would be surprised by performance if you're coming from something like PHP or Python. Nest heavily uses Typescript decorator annotations. Controllers, routes, modules, data transfer objects, params, query params and even swagger documentation is annotation based.

While working nest one of main cons is the debugging. It integrates with other frameworks (express/fastify) and npm packages (class-validator, TypeORM). That's all nice, and I respect that maintainers and contributors of Nest that do their best to leverage what's available and avoiding reinventing the wheel.

Though sometimes there is an error and everything you get either nothing in the console or empty object {}.
Good news is that it doesn't happen too often.

Because node is on a server it needs to parse and load javascript into memory before it can execute it, so on file change ( deployment ) you must restart it to changes appear. If you have a mission critical application in mind maybe you should consider a load balancer or use a docker. Cloud based solutions such as Google cloud App engine also can be an option!

Nest's documentation isn't the worst, but it can there is a room for improvement, and I hope it will get better. You probably will have a question while working and might have a to dig a little deeper in stack overflow to find answer or advice to point in the right direction.

All in all I love how NestJs is growing. Since the end of 2018 ( ~20k weekly downloads ) till 2019 June ( ~65k weekly downloads) it has grown by more 300% according to npmjs.com. I plan to use it where I have a chance, because I really enjoy working with it. Definitely I see it growing more in popularity and surpassing every other backend javascript frameworks such as AdonisJs or SailsJs.
So give it a spin and try it out for yourself.
There is a little of learning curve, but I'm sure it's nothing too much.

Cheers!
Karolis