# Bun — All-in-One JavaScript Runtime & Toolkit > Ultra-fast JavaScript runtime, bundler, test runner, and package manager in one tool. 4x faster than Node.js, drop-in compatible. Written in Zig with JavaScriptCore engine. 78,000+ stars. ## Install Save as a script file and run: ## Quick Use ```bash # Install curl -fsSL https://bun.sh/install | bash # Run JavaScript/TypeScript directly bun run server.ts # Install packages (fastest package manager) bun install # Bundle for production bun build ./src/index.ts --outdir ./dist # Run tests bun test ``` --- ## Intro Bun is an all-in-one JavaScript runtime, bundler, test runner, and package manager with 78,000+ GitHub stars. Written in Zig with the JavaScriptCore engine (Safari), it runs JavaScript and TypeScript 4x faster than Node.js while being drop-in compatible with most Node.js code. One tool replaces node, npm, npx, webpack, jest, and tsx. Best for JavaScript/TypeScript developers who want maximum speed with minimal tooling complexity. Works with: any Node.js project (drop-in compatible). Setup time: under 1 minute. --- ## What Bun Replaces | Old Tool | Bun Equivalent | Speed | |----------|---------------|-------| | Node.js | `bun run` | 4x faster startup | | npm install | `bun install` | 25x faster | | npx | `bunx` | 5x faster | | webpack/esbuild | `bun build` | 2x faster than esbuild | | jest/vitest | `bun test` | 8x faster than jest | | tsx/ts-node | Native TypeScript | No transpilation step | ### Runtime Performance ``` # HTTP server benchmark (requests/second) Bun: 145,000 req/s Node.js: 36,000 req/s Deno: 67,000 req/s ``` ### Native TypeScript Run `.ts` files directly — no `tsconfig.json`, no build step: ```bash bun run server.ts # Just works ``` ### Package Manager Speed ```bash # Installing a fresh Next.js project npm install: 45 seconds bun install: 1.8 seconds (25x faster) ``` ### Built-in Test Runner ```typescript // math.test.ts import { expect, test } from "bun:test"; test("addition", () => { expect(2 + 2).toBe(4); }); ``` ```bash bun test # Runs all .test.ts files ``` ### Built-in Bundler ```bash bun build ./src/index.ts --outdir ./dist --minify ``` ### Node.js Compatibility Bun implements most Node.js APIs: - `fs`, `path`, `http`, `crypto`, `stream` - `process.env`, `__dirname`, `require()` - npm packages work as-is ### Bun-Specific APIs ```typescript // Fast file I/O const file = Bun.file("data.json"); const data = await file.json(); // Built-in SQLite import { Database } from "bun:sqlite"; const db = new Database("mydb.sqlite"); // Fast HTTP server Bun.serve({ port: 3000, fetch(req) { return new Response("Hello from Bun!"); }, }); ``` ### Key Stats - 78,000+ GitHub stars - 4x faster than Node.js - 25x faster package install - Native TypeScript support - Drop-in Node.js compatible ### FAQ **Q: What is Bun?** A: Bun is an all-in-one JavaScript runtime, package manager, bundler, and test runner that is 4x faster than Node.js and drop-in compatible with most Node.js code. **Q: Is Bun free?** A: Yes, fully open-source under MIT license. **Q: Can I use Bun in production?** A: Yes, Bun 1.0+ is production-ready. Companies like Figma and Sentry use it. --- ## Source & Thanks > Created by [Oven](https://github.com/oven-sh). Licensed under MIT. > > [bun](https://github.com/oven-sh/bun) — ⭐ 78,000+ Thanks to Oven for making JavaScript fast again. --- ## 快速使用 ```bash curl -fsSL https://bun.sh/install | bash bun run server.ts # 直接运行 TypeScript bun install # 25 倍速包安装 bun test # 内置测试运行器 ``` --- ## 简介 Bun 是一个全能 JavaScript 运行时、打包器、测试器和包管理器,GitHub 78,000+ stars。用 Zig 编写,比 Node.js 快 4 倍。一个工具替代 node、npm、webpack、jest。原生支持 TypeScript。适合追求极致速度的 JS/TS 开发者。 --- ## 来源与感谢 > Created by [Oven](https://github.com/oven-sh). Licensed under MIT. > > [bun](https://github.com/oven-sh/bun) — ⭐ 78,000+ --- Source: https://tokrepo.com/en/workflows/944f2eb4-59c1-4ea8-91b9-2b682c0bd5a4 Author: Script Depot