I recently started testing out bun to see where I could save myself some time. I can without a doubt say that bun is going to flip the entire Node ecosystem on its head. Here are 5 reasons why I'm switching to Bun for good.
You can run TSX, TS out of the box without Transpiling. You've already saved seconds by just using #bun.
bun has a built in test framework, no more installing jest, mocha, chai, whatever to start testing your code. It's there. It's ready. You can write tests immediately and even has a built in watch mode. No more nodemon, or tsc --watch or whatever other flavor of file watcher you're using.
bun has a built in HTTP API that will let you construct new REST APIs with minimal code. I can have a working REST API up and running in less than 3 minutes and get it deployed within the hour.
bun has a built in bundling system that makes all code whether it's ESM (import), or CommonJS (require) Transpile down into a fully browser compatible format. This is huge because now nobody needs to trudge through why imports might be acting funny in a module based package. Everything just works. Period.
bun is compatible with 99% of npm packages out-of-the-box which means that switching over existing projects to bun is probably already compatible.
Bonus:
- FFI isn't anything new to Node.js but in bun it's very easy. FFI allows for us to write function calls to lower level languages such as C, C++, Rust, etc. Which in turn increases the performance of our applications when it makes sense.
Don't sleep on bun, do your due diligence and build something with it. It's an incredible runtime and LOWERS the overall complexity of your project by 10 fold.
Top comments (0)