← All articles

Bun 1.0 in dev: is it ready to replace Node? Almost.

04 December 20232 min read

Test runner, package manager, runtime: Bun 1.0 is already faster than Node at everything. Is that enough to ship it?

Bun released 1.0 in September 2023. Three months later we tried it in dev on an internal app (Express + Prisma + 14k LOC TypeScript) and on a mid-size Next.js project.

Install

bun install did npm install's job in 4.2 seconds vs 38. A 10x factor. On CI builds for big projects, this alone pays the transition.

Test runner

The API is nearly identical to Vitest/Jest. Our 480-test suite ran in 6.1s on Vitest. On Bun: 2.4s. No magic, just fast.

Runtime

Running the Express app with bun run start we got +35% throughput on a synthetic benchmark. In production the gap is smaller because the bottleneck is almost always the database, not runtime CPU.

What does not work yet

  • Native modules: some N-API-dependent packages (sharp, bcrypt) had workarounds in 1.0; better now, still verify.
  • Cluster mode / worker_threads: parity with Node not yet complete.
  • Production hosting: at end of 2023 nearly no PaaS (Vercel, Railway, Fly) natively supports Bun. Docker works, less convenient.

Verdict

For dev experience: already today. bun install and bun test are the first change we make in our repos. For production: we wait until mid-2024, when host support matures and our experience is firmer.