DEV Community

Cover image for Will Bun replace Node.js? First try with NestJS
Rodion
Rodion

Posted on

Will Bun replace Node.js? First try with NestJS

Many people recently talked about Bun, so we decided to try it.

Bun is a fast JavaScript all-in-one toolkit that helps to develop, test, run, and bundle JavaScript & TypeScript projects. It claims to be really fast in terms of runtime and development. So it should not only make the app faster but speed up the development process too. Take a look at their video presentation on YouTube.

Our idea was to run our Brocoders Nest.js Boilerplate on Bun and see how it performs. The test was made on MacBook Pro 2GHz, 16Gb memory:

Image description

So we tried to install dependencies with npm install and bun. The difference is pretty decent: 32s npm and 5s bun.

Image description

Image description

But then we tried to run it, there was an error appeared on the screen:

Image description

The problem is connected with emitDecoratorMetadata feature that is not supported by Bun yet. There is an issue with it on Github: https://github.com/nestjs/nest/issues/12359#issuecomment-1712712949
So, finally, I would say that Bun is really a perspective thing, but so far, it seems it's not ready for production yet. But we will definitely watch this repository and come back to it later.

Top comments (0)