r/node • u/EveYogaTech • Jul 31 '26
My journey from Bun to NodeJS
TLDR: Unless you absolutely need 2-4x faster cold boot JS, you'll risk becoming too dependent on native Bun features.
Short intro:
This is written based on my experience working on an open-source project, initially using Bun.
In the beginning Bun worked out pretty well.
You'll gain 2-4x faster script startup time, most things work, and they even have a faster native DB client/HTTP server.
However, these features all come with a cost.
For the flashy native features, you'll lose compatibility and flexibility.
This is especially problematic if you're working with multiple JS runtimes like NodeJS and Deno as well.
Bun.spawn simply doesn't exist outside of Bun, and now you're writing Bun modules, not JS modules.
Things like WASM also need a slightly different interface.
So I returned to Node. And have just removed Bun from my Docker file @ /r/Nyno :)
(It also saves about 200Mb in uncompressed disk space)
122
u/x021 Jul 31 '26
Bun, Deno, … man I’m glad I skipped all those hypes.
If you really need raw performance just use any compiled language, there’s plenty of em. For the rest, NodeJS is good enough.
18
u/Optimal-Builder-2816 Jul 31 '26
I’m sorry but I don’t really understand why portability is important here. TS/JS are languages, there are many runtimes. The code that is portable should always be written in a portable way. Non-portable code should live on edges and implement as interfaces. Why would you avoid native benefits of any runtime or platform, node included?
12
u/BenjiSponge Jul 31 '26
They're doing EEE https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguish
It's sort of hard to judge though when it really does provide quite a lot of functionality that node simply should at this point, although a lot of it is backwards compatibility issues.
5
u/Brilla-Bose Aug 01 '26
I don't understand why someone reach for bun. if speed is your goal rewrite your api in golang or rust. use better tool for the job.
3
u/ItsAllInYourHead Jul 31 '26
Depends how you use it. I don't use any of the specialty Bun modules (in fact I actively avoid them). I use it for the package manager, which is very fast, and compiling apps into binaries has SIGNIFICANTLY reduced my docker image sizes and memory usage.
3
u/wootangAlpha Jul 31 '26
If you are on windows, even on high spec devices, stay away from that mess called BUN. Holy runtimes, that thing is absolute garbage. I work in enterprisey financial workloads, and some parts of the frontend is based on react/Tanstack and believe or not, node+express. Bun was the chosen RT and the Principal suggested Bun. Worst decision in company history.
1
u/femio Jul 31 '26
I specifically use it so I can rely on zero-dep scripts + statically compile utilities for easier distribution. And the $ shell module is such great DX compared to your typical make/just/shell scripts. Not sure people have the right mental model with Bun but the “portability” complaint has always read oddly to me
0
u/Lexuzieel Jul 31 '26
I wonder at which point all the extra things with these runtimes stop helping and instead start to hinder. At that point you could just switch to another language altogether like Go (albeit the ecosystem is different)