Backend
Bun
A fast JavaScript and TypeScript runtime that bundles a runtime, package manager, bundler and test runner.
What it is
Bun is written in Zig and runs on Safari's JavaScriptCore engine rather than V8. The idea is one fast tool in place of Node, npm, a bundler and Jest.
bun install is often several times faster than npm, and bun test has a Jest-compatible API. TypeScript and JSX run with no setup.
Bun aims for compatibility with Node APIs and npm packages, but coverage is not complete, so check your critical dependencies before migrating.
Use it when
- You want faster dependency installs and test runs in CI.
- New small services and scripts in TypeScript.
- You need one tool for runtime, build and tests.
Avoid it when
- Critical dependencies with native addons or rarely used Node APIs.
- Conservative production where a long stability record matters: Node has more of it.
Key concepts
- JavaScriptCore
- The WebKit JS engine, different from V8.
- bun install
- A fast package manager with its own lockfile.
- Bun.serve
- The built-in HTTP server on standard Request/Response.
- bun test
- A test runner with a Jest-like API.
Example
Interview questions
1. Why is Bun fast?
It is written in Zig, uses JavaScriptCore and has optimized built-in I/O, package manager and bundler. Part of the speed is lower startup overhead.
2. Does Bun fully replace Node?
No, compatibility is high but not complete. Native modules and rare APIs may fail, so verify dependencies with tests.
3. What does Bun do besides run code?
It installs packages, bundles, runs tests and has built-in SQLite and S3 clients. That cuts the number of dependencies in a project.
Related technologies
- Node.jsA server-side JavaScript runtime built on the V8 engine with an event-driven, non-blocking I/O model.
- DenoA secure JavaScript and TypeScript runtime from the creator of Node.js, with built-in tooling.
- TypeScriptA superset of JavaScript with static types that compiles to plain JS.
- ViteA fast dev server and bundler for frontend, built on native ES modules.
Logos belong to their owners and are used for identification only. Icons: Simple Icons (CC0), Devicon (MIT).