bun run index.tsx # TS and JSX supported out of the box
bun command-line tool also implements a test runner, script runner, and Node.js-compatible package manager, all significantly faster than existing tools and usable in existing Node.js projects with little to no changes necessary.
bun run start # run the `start` script
bun install <pkg> # install a package
bun build ./index.tsx # bundle a project for browsers
bun test # run tests
bunx cowsay 'Hello, world!' # execute a package
Bun is still under development. Use it to speed up your development workflows or run simpler production code in resource-constrained environments like serverless functions. We're working on more complete Node.js compatibility and integration with existing frameworks. Join the Discord and watch the GitHub repository to keep tabs on future releases.
Get started with one of the quick links below, or read on to learn more about Bun.
Do the quickstart
Install a package
Use a project template
Bundle code for production
Build an HTTP server
Build a Websocket server
Read and write files
Run SQLite queries
Write and run tests
__dirname in addition to built-in modules for performing OS-level tasks like reading/writing files (
node:fs) and networking (
Bun is designed as a faster, leaner, more modern replacement for Node.js.
- Speed. Bun processes start 4x faster than Node.js currently (try it yourself!)
- TypeScript & JSX support. You can directly execute
- ESM & CommonJS compatibility. The world is moving towards ES modules (ESM), but millions of packages on npm still require CommonJS. Bun recommends ES modules, but supports CommonJS.
- Web-standard APIs. Bun implements standard Web APIs like
URLdirectly use Safari's implementation.
- Node.js compatibility. In addition to supporting Node-style module resolution, Bun aims for full compatibility with built-in Node.js globals (
Buffer) and modules (
http, etc.) This is an ongoing effort that is not complete. Refer to the compatibility page for the current status.