← all field notes
say hi

Why I Love Bun

1 min read #bun #javascript #runtime

I have been using Node.js for years. npm install was a ritual. Wait, wait, wait. Then it was done. Then you realize you need to install types, then a bundler, then a test runner, then a dozen other tools.

Then I found Bun.

The first install

curl -fsSL https://bun.sh/install | bash

That was it. One command. No need to install npm, nvm, or anything else. Bun comes with everything.

Speed

The difference is not subtle. A bun install on a project with hundreds of dependencies takes seconds. With npm, it was minutes. The test runner is faster. The bundler is faster. Everything is faster.

TypeScript out of the box

No need for ts-node, tsx, or any transpiler. Bun just runs TypeScript natively. You write .ts files and they work.

One tool instead of many

Bun replaces:

  • Node.js (runtime)
  • npm/pnpm/yarn (package manager)
  • esbuild/webpack/vite (bundler)
  • jest/vitest (test runner)

One binary. One config. It just works.

When I still use Node.js

Some projects still need Node.js. Some dependencies only work with Node. Some deployment targets only support Node. But for everything else, I reach for Bun.

Getting started

If you haven’t tried Bun, I recommend it. Start a new project, run bun init, and see how fast it feels. Then compare it to your existing workflow.

Biraj, from basecamp in Sindhuli, Nepal

Questions

Why use Bun instead of Node.js?
One binary covers the runtime, package manager, bundler and test runner, and installs take seconds instead of minutes. TypeScript runs without a transpiler.
Does TypeScript work in Bun without setup?
Yes. Bun runs .ts files directly, so ts-node, tsx and similar tools are not needed.
When does Biraj Rai still use Node.js?
When a dependency or a deployment target only supports Node. Everything else runs on Bun.
Next trail Why Go Is My Backend Language of Choice follow Yakku →