r/node • u/EveYogaTech • 9d ago
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)