Bun Documentation
Official Bun docs (sourced from github.com/oven-sh/bun/docs).
CRITICAL: grep references/ for keywords before answering.
Topic Index
Runtime
runtime/— Core runtime: watch mode, debugger, REPL, bunfigruntime/http/— HTTP server, routing, cookies, TLS, WebSocket, metricsruntime/networking/— fetch, TCP, UDP, DNSruntime/file-io.mdx— File I/O, streams, binary dataruntime/sql.mdx,runtime/sqlite.mdx— SQL, SQLiteruntime/s3.mdx,runtime/redis.mdx— S3, Redisruntime/shell.mdx— Shell scripting ($...)runtime/workers.mdx— Web Workersruntime/ffi.mdx,runtime/c-compiler.mdx— FFI, C compilerruntime/plugins.mdx— Runtime pluginsruntime/jsx.mdx,runtime/typescript.mdx— JSX, TypeScript
Package Manager
pm/cli/— install, add, remove, update, publish, audit, link, patch, outdatedpm/workspaces.mdx— Workspacespm/lockfile.mdx— Lockfile formatpm/overrides.mdx— Dependency overridespm/scopes-registries.mdx— Scopes and registries
Bundler
bundler/— Bun.build(), plugins, loaders, macros, CSS, HTMLbundler/executables.mdx— Single-file executablesbundler/fullstack.mdx— Fullstack dev serverbundler/hot-reloading.mdx— Hot module reloading
Test Runner
test/— bun test: writing tests, mocks, snapshots, lifecycle, DOM, coverage, reporters
Guides
guides/ecosystem/— Framework integration: Next.js, React, Vite, Express, Hono, Elysia, Prisma, Docker...guides/deployment/— Deploy to Vercel, Railway, AWS Lambda, etc.guides/http/— HTTP recipes: server, fetch, proxy, SSE, file uploads, streamingguides/websocket/— WebSocket: simple, pub/sub, compressionguides/test/— Testing recipes: Jest migration, mocks, coverage, happy-domguides/install/— Package management recipesguides/binary/— Binary data conversions (ArrayBuffer, Buffer, Blob, TypedArray)guides/streams/— Stream conversionsguides/read-file/,guides/write-file/— File I/O recipesguides/process/— Process: spawn, IPC, signals, stdinguides/runtime/— Runtime recipes: env vars, TypeScript, debugging, CI/CDguides/util/— Utilities: hashing, UUID, base64, gzip, sleep