Bun JS, the New Alternative to Node JS

As you know, on May 27, 2009, an open-source runtime was released: Node JS. It revolutionized server-side applications and made the things everyone called impossible a reality, but now it has a new rival, and it is no longer alone.
Who is this newcomer?
Bun, yes, that's its name. Bun is a new open-source runtime env, created by Jared Sumner and 40 developers, as an alternative to NodeJS. Moreover, it is not a runtime built to be an alternative just for the sake of it. In terms of performance, it leaves Node JS well behind.

According to its creator, it was built with this mentality:
- Start fast.
- Have new levels of performance.
- To be a great and complete tool.
Also, Jared really emphasized this in the beta release: a complete and incredibly fast JavaScript environment.

So what is this speed they talk about? 🚀
Bun has openly shared benchmarks on its website's homepage:



I didn't mention it at the beginning of the article, but there's also our buddy deno in this race 😄
How does Bun work?
The most important feature that sets Bun apart from node and deno is that it uses the JavaScriptCore engine instead of the V8 engine developed for Chrome. Also, Bun has been written from scratch in a low-level programming language called ZIG, which works with manual memory management.
Why is Bun faster?
When we ask this, Bun attributes it mostly to the ZIG programming language and promotes ZIG in many places.
Features
- People who have used Bun say that it is 90% similar to Node in terms of usage. So if Bun becomes as popular as Node one day, the migration won't be a nightmare.
- Env variable support, which I always wondered why Node doesn't have and for which we have to install a package, comes built in automatically in Bun. (so bye bye dotenv)
- It uses its own native package manager instead of Webpack.
Of course, I recommend that you don't get hyped by these benchmarks and start using Bun in your project. Bun is still very new and I'm sure it's full of bugs. As the name suggests, it's in beta.
I don't know whether Bun can dethrone Node JS. Competition in the market always brings quality. We can say Bun is good news for JavaScript lovers.
Thanks for reading.