# Bun ## Docs - [CSS Bundling](https://mintlify.wiki/oven-sh/bun/bundler/css.md): Bun's built-in CSS bundler supports modern CSS features, syntax lowering for browser compatibility, and CSS Modules — no PostCSS or separate build tool required. - [Single-File Executables](https://mintlify.wiki/oven-sh/bun/bundler/executables.md): Compile TypeScript and JavaScript into self-contained binaries that include the Bun runtime — no Node.js or Bun installation required to run. - [Fullstack Development](https://mintlify.wiki/oven-sh/bun/bundler/fullstack.md): Build fullstack applications with Bun's integrated dev server that bundles frontend assets and serves API routes in a single process. - [Loaders](https://mintlify.wiki/oven-sh/bun/bundler/loaders.md): Built-in loaders for all common file types — JavaScript, TypeScript, JSX, JSON, TOML, YAML, CSS, HTML, and more. - [Macros](https://mintlify.wiki/oven-sh/bun/bundler/macros.md): Run JavaScript functions at bundle time and inline their return values directly into your bundle — useful for build-time constants, data fetching, and code generation. - [Minifier](https://mintlify.wiki/oven-sh/bun/bundler/minifier.md): Reduce bundle size and improve startup time with Bun's fast JavaScript and TypeScript minifier. Supports whitespace removal, syntax optimization, identifier shortening, and bytecode compilation. - [Bundler Overview](https://mintlify.wiki/oven-sh/bun/bundler/overview.md): Bun's fast native bundler for JavaScript, TypeScript, JSX, and CSS — with zero configuration required. - [Bundler Plugins](https://mintlify.wiki/oven-sh/bun/bundler/plugins.md): Extend Bun's bundler with custom loaders, module resolution, and build lifecycle hooks using a universal plugin API compatible with both the runtime and bundler. - [Deploy to AWS Lambda](https://mintlify.wiki/oven-sh/bun/guides/aws-lambda.md): Deploy a Bun HTTP server to AWS Lambda using a Docker container image and the AWS Lambda Web Adapter. - [Deploy with Docker](https://mintlify.wiki/oven-sh/bun/guides/docker.md): Containerize your Bun application using the official oven/bun Docker images with a production-ready multi-stage Dockerfile. - [Elysia Framework](https://mintlify.wiki/oven-sh/bun/guides/elysia.md): Build a type-safe, high-performance HTTP server with Elysia, a framework designed specifically for Bun. - [Express with Bun](https://mintlify.wiki/oven-sh/bun/guides/express.md): Run an Express.js server with Bun using Bun's built-in Node.js compatibility layer. - [Hono Framework](https://mintlify.wiki/oven-sh/bun/guides/hono.md): Build a lightweight, fast HTTP server with Hono, a web framework that runs natively on Bun. - [Migrating from Jest](https://mintlify.wiki/oven-sh/bun/guides/migrate-from-jest.md): Replace Jest with Bun's built-in test runner. Most test suites run without any code changes — just swap the command. - [Migrating from Node.js](https://mintlify.wiki/oven-sh/bun/guides/migrate-from-node.md): Replace Node.js with Bun as a drop-in runtime. Most projects require only a few command substitutions and no code changes. - [Next.js with Bun](https://mintlify.wiki/oven-sh/bun/guides/nextjs.md): Use Bun as the package manager and script runner for a Next.js project for faster installs and development workflows. - [Deploy to Railway](https://mintlify.wiki/oven-sh/bun/guides/railway.md): Deploy Bun applications to Railway with zero-configuration builds, automatic SSL, and optional PostgreSQL provisioning. - [React with Bun](https://mintlify.wiki/oven-sh/bun/guides/react.md): Create and run a full-stack React application with Bun, including built-in JSX support, hot reloading, and production bundling. - [Deploy to Vercel](https://mintlify.wiki/oven-sh/bun/guides/vercel.md): Deploy a Bun application to Vercel using the Bun runtime for Vercel Functions, including configuration, Next.js support, and environment variables. - [Installation](https://mintlify.wiki/oven-sh/bun/installation.md): Install Bun on macOS, Linux, or Windows using the install script, a package manager, or Docker. - [Introduction](https://mintlify.wiki/oven-sh/bun/introduction.md): Bun is an all-in-one JavaScript and TypeScript toolkit — runtime, package manager, bundler, and test runner in a single fast binary. - [Adding & Removing Packages](https://mintlify.wiki/oven-sh/bun/pm/add-remove.md): Add and remove dependencies with bun add and bun remove. - [Security Audit](https://mintlify.wiki/oven-sh/bun/pm/audit.md): Check installed packages for known vulnerabilities with bun audit. - [bunx](https://mintlify.wiki/oven-sh/bun/pm/bunx.md): Run a package from npm without installing it globally, like npx but significantly faster. - [Global Cache](https://mintlify.wiki/oven-sh/bun/pm/global-cache.md): How Bun stores downloaded packages in a global cache to speed up installs and save disk space. - [bun install](https://mintlify.wiki/oven-sh/bun/pm/install.md): Install all dependencies from package.json with Bun's fast package manager — up to 25x faster than npm. - [Lifecycle Scripts](https://mintlify.wiki/oven-sh/bun/pm/lifecycle.md): How Bun handles package lifecycle scripts securely, with explicit trust required for dependency scripts. - [Lockfile](https://mintlify.wiki/oven-sh/bun/pm/lockfile.md): Bun's lockfile ensures reproducible installs across machines and over time. - [Overrides & Resolutions](https://mintlify.wiki/oven-sh/bun/pm/overrides.md): Force specific versions of transitive dependencies using npm overrides or Yarn resolutions. - [Publishing Packages](https://mintlify.wiki/oven-sh/bun/pm/publish.md): Publish packages to the npm registry with bun publish. - [Registries & Scopes](https://mintlify.wiki/oven-sh/bun/pm/registries.md): Configure custom registries, scoped packages, and authentication tokens for private npm registries. - [Updating Packages](https://mintlify.wiki/oven-sh/bun/pm/update.md): Update dependencies to their latest versions with bun update and bun outdated. - [Workspaces](https://mintlify.wiki/oven-sh/bun/pm/workspaces.md): Build monorepos with multiple packages using Bun's workspace support. - [Quickstart](https://mintlify.wiki/oven-sh/bun/quickstart.md): Build a working HTTP server with Bun in under 5 minutes. - [Child Processes](https://mintlify.wiki/oven-sh/bun/runtime/child-process.md): Spawn and manage child processes with Bun.spawn() and Bun.spawnSync(), with full Node.js child_process compatibility. - [Debugger](https://mintlify.wiki/oven-sh/bun/runtime/debugger.md): Debug Bun scripts interactively using the WebKit Inspector Protocol with Chrome DevTools or VS Code. - [Environment Variables](https://mintlify.wiki/oven-sh/bun/runtime/environment-variables.md): Bun automatically loads .env files and provides idiomatic ways to read and write environment variables in your project. - [Fetch](https://mintlify.wiki/oven-sh/bun/runtime/fetch.md): Bun implements the WHATWG fetch standard with server-side extensions for proxies, Unix sockets, TLS, streaming, and more. - [Foreign Function Interface (FFI)](https://mintlify.wiki/oven-sh/bun/runtime/ffi.md): Call native C/C++, Rust, and Zig libraries from JavaScript using bun:ffi. - [File I/O](https://mintlify.wiki/oven-sh/bun/runtime/file-io.md): Read and write files using Bun's optimized file I/O APIs, including BunFile, FileSink, and directory operations via node:fs. - [File Types](https://mintlify.wiki/oven-sh/bun/runtime/file-types.md): File types and built-in loaders supported by Bun's runtime and bundler. - [HTTP Server](https://mintlify.wiki/oven-sh/bun/runtime/http-server.md): Start a high-performance HTTP server with Bun.serve(). Supports routing, streaming, TLS, WebSockets, and more. - [Module Resolution](https://mintlify.wiki/oven-sh/bun/runtime/module-resolution.md): How Bun resolves ES modules, CommonJS modules, path aliases, and package exports. - [Node.js compatibility](https://mintlify.wiki/oven-sh/bun/runtime/nodejs-compat.md): Bun aims to be a drop-in replacement for Node.js. This page tracks compatibility with Node.js built-in modules, globals, and native addons. - [Runtime Overview](https://mintlify.wiki/oven-sh/bun/runtime/overview.md): Execute JavaScript and TypeScript files with Bun's fast runtime, powered by JavaScriptCore. - [Plugins](https://mintlify.wiki/oven-sh/bun/runtime/plugins.md): Extend Bun's runtime and bundler with custom loaders, module resolution, and native hooks. - [S3 Object Storage](https://mintlify.wiki/oven-sh/bun/runtime/s3.md): Read, write, stream, and presign files on S3-compatible object storage using Bun's built-in S3 client — no npm package required. - [Shell Scripting](https://mintlify.wiki/oven-sh/bun/runtime/shell.md): Bun Shell is a cross-platform, bash-like shell built into Bun that lets you run shell commands from JavaScript and TypeScript using tagged template literals. - [SQL (PostgreSQL & MySQL)](https://mintlify.wiki/oven-sh/bun/runtime/sql.md): Connect to PostgreSQL, MySQL, and SQLite using Bun's built-in SQL client — a unified, Promise-based API with tagged template literals, connection pooling, and transactions. - [SQLite](https://mintlify.wiki/oven-sh/bun/runtime/sqlite.md): Use the built-in bun:sqlite module for fast, synchronous SQLite3 access with prepared statements, transactions, and WAL mode. - [Streams](https://mintlify.wiki/oven-sh/bun/runtime/streams.md): Work with ReadableStream, WritableStream, and TransformStream in Bun, including direct streams, async generators, ArrayBufferSink, and Node.js stream compatibility. - [TCP & UDP](https://mintlify.wiki/oven-sh/bun/runtime/tcp-udp.md): Low-level TCP and UDP networking with Bun.listen(), Bun.connect(), and Bun.udpSocket() for building database clients, game servers, and real-time applications. - [Watch Mode](https://mintlify.wiki/oven-sh/bun/runtime/watch-mode.md): Automatically reload your Bun scripts and tests on file changes using --watch or --hot. - [Web APIs](https://mintlify.wiki/oven-sh/bun/runtime/web-apis.md): Bun implements Web-standard APIs so your server-side code shares the same interfaces as the browser. - [WebSockets](https://mintlify.wiki/oven-sh/bun/runtime/websockets.md): Build WebSocket servers with Bun.serve(). Includes pub/sub, compression, contextual data, and a native WebSocket client. - [Web Workers](https://mintlify.wiki/oven-sh/bun/runtime/workers.md): Run JavaScript in parallel using Bun's Worker API — a Web-standard implementation with extensions for server-side use cases. - [Code Coverage](https://mintlify.wiki/oven-sh/bun/test/code-coverage.md): Generate coverage reports with bun test --coverage to find untested code, enforce thresholds, and integrate with CI/CD pipelines. - [Test Configuration](https://mintlify.wiki/oven-sh/bun/test/configuration.md): Configure bun test behavior using bunfig.toml and command-line flags, including timeouts, preload scripts, coverage, and reporters. - [DOM Testing](https://mintlify.wiki/oven-sh/bun/test/dom.md): Test browser APIs, DOM elements, and React components in Bun using happy-dom and React Testing Library. - [Test Lifecycle](https://mintlify.wiki/oven-sh/bun/test/lifecycle.md): Use beforeAll, beforeEach, afterEach, afterAll, and onTestFinished hooks to set up and tear down state around your tests. - [Mocks & Spies](https://mintlify.wiki/oven-sh/bun/test/mocks.md): Create mock functions, spy on existing methods, and replace entire modules using bun:test's mocking API. - [Test Runner](https://mintlify.wiki/oven-sh/bun/test/overview.md): Bun ships with a fast, built-in, Jest-compatible test runner with TypeScript support, lifecycle hooks, mocking, snapshot testing, and watch mode. - [Snapshots](https://mintlify.wiki/oven-sh/bun/test/snapshots.md): Use snapshot testing in Bun to capture and compare output across test runs, with support for inline snapshots, error snapshots, and property matchers. - [Writing Tests](https://mintlify.wiki/oven-sh/bun/test/writing-tests.md): Learn how to write tests using Bun's Jest-compatible API, including async tests, matchers, test modifiers, and parameterized tests. - [TypeScript](https://mintlify.wiki/oven-sh/bun/typescript.md): Bun executes TypeScript natively without a separate compilation step. No build tool or tsconfig required to get started. ## OpenAPI Specs - [openapi](https://mintlify.wiki/oven-sh/bun/api-reference/openapi.json)