One of the first powerful frameworks was Express.js, which was released in 2010, built on the Middlewares principle, which raised it to the peak of popularity and became a reason for hate in advanced Node.js developer circles. After all, a large number of mutations in the chain led to long and difficult searches for the source of problems in the old code.
And the low learning curve, along with a lot of ready-made solutions, the lack of a clear structure that hits the hands, still gives it such a high popularity.
At some point, Express developers realized some of the problems with this framework and subsequently released Koa.js. It is built on the basis of its older brother, so it gives a similar development experience, but complements it with more simplifications where they have already thought for you.
The main differences are:
- elimination of work with callbacks;
- async/await syntax is used;
- has an error handler (including asynchronous errors) out of the box;
- cleans up the cache, supports proxy matching and the content of your endpoints.
Like Express, it can be used to build server applications of any level. Despite significant bug fixes and greater efficiency in some scenarios, Koa is not a replacement for Express, but only an alternative with a much smaller community, so it is unlikely to be suitable for beginners.
In IT, practices and approaches are often transferred from one language to another. That’s how we got the well-known C-like syntax, which is shared by Java, C++, C#, JS, Rust, Go, and many other languages. The same thing happens in the world of frameworks. An example is Adonis.js, whose developers repeated the MVC approach of the popular PHP framework Laravel. This is a serious and reliable framework that takes care of all the support out of the box:
- dependency management (supports Dependency Injection);
- error handling;
- email distribution;
- data validation;
- integration with Redis.
It all looks like “take and develop”, without thinking about any low-level things and customization, and gives significant advantages in development speed.
Another high-level framework with a clear structure and DI support, mandatory use of TypeScript and OOP approach.
It is called “Angular in the backend world”, and it is true, because the developers were inspired by Angular.
The framework has a great CLI, a structure that has no room for error, good documentation, where you can find examples of most use cases.
Another interesting fact is that under the hood, Nest is able to use various low-level frameworks, out of the box it is Express, but you can easily switch to, for example, Fastify.
Although it’s not very popular, I fell in love with this framework at first sight. It is the right middle ground for me between a clear structure and freedom.
On the one hand, it’s similar to Express in terms of writing code, but it doesn’t have Middlewares, it supports asynchronous error handling, and it allows you to write clean functions.