# Bun 中文文档 ## Docs - [字节码缓存](https://bun.zhcndoc.com/bundler/bytecode.md): 使用 Bun 打包器中的字节码缓存加速 JavaScript 执行 - [CSS](https://bun.zhcndoc.com/bundler/css.md): Bun 的打包工具内置支持带有现代特性的 CSS - [esbuild](https://bun.zhcndoc.com/bundler/esbuild.md): 从 esbuild 迁移到 Bun 的打包器指南 - [独立可执行文件](https://bun.zhcndoc.com/bundler/executables.md): 使用 Bun 从 TypeScript 或 JavaScript 文件生成独立可执行文件 - [全栈开发服务器](https://bun.zhcndoc.com/bundler/fullstack.md): 使用 Bun 集成的开发服务器构建全栈应用,它能够打包前端资源并处理 API 路由 - [热重载](https://bun.zhcndoc.com/bundler/hot-reloading.md): Bun 开发服务器的热模块替换(HMR) - [HTML 和静态站点](https://bun.zhcndoc.com/bundler/html-static.md): 使用 Bun 的打包工具构建静态站点、落地页和 web 应用 - [Bundler](https://bun.zhcndoc.com/bundler/index.md): Bun 的快速原生打包器,支持 JavaScript、TypeScript、JSX 等多种语言 - [加载器](https://bun.zhcndoc.com/bundler/loaders.md): Bun 打包器和运行时内置加载器 - [宏](https://bun.zhcndoc.com/bundler/macros.md): 使用 Bun 宏在打包时运行 JavaScript 函数 - [Minifier](https://bun.zhcndoc.com/bundler/minifier.md): 使用 Bun 的 JavaScript 和 TypeScript 压缩器减少包大小 - [插件](https://bun.zhcndoc.com/bundler/plugins.md): 用于扩展 Bun 运行时和打包器的通用插件 API - [独立 HTML](https://bun.zhcndoc.com/bundler/standalone-html.md): 将单页应用打包成一个无外部依赖的自包含 `.html` 文件 - [反馈](https://bun.zhcndoc.com/feedback.md): 分享反馈、错误报告和功能请求 - [将 ArrayBuffer 转换为数字数组](https://bun.zhcndoc.com/guides/binary/arraybuffer-to-array.md) - [将 ArrayBuffer 转换为 Blob](https://bun.zhcndoc.com/guides/binary/arraybuffer-to-blob.md) - [将 ArrayBuffer 转换为 Buffer](https://bun.zhcndoc.com/guides/binary/arraybuffer-to-buffer.md) - [将 ArrayBuffer 转换为字符串](https://bun.zhcndoc.com/guides/binary/arraybuffer-to-string.md) - [将 ArrayBuffer 转换为 Uint8Array](https://bun.zhcndoc.com/guides/binary/arraybuffer-to-typedarray.md) - [将 Blob 转换为 ArrayBuffer](https://bun.zhcndoc.com/guides/binary/blob-to-arraybuffer.md) - [将 Blob 转换为 DataView](https://bun.zhcndoc.com/guides/binary/blob-to-dataview.md) - [将 Blob 转换为 ReadableStream](https://bun.zhcndoc.com/guides/binary/blob-to-stream.md) - [将 Blob 转换为字符串](https://bun.zhcndoc.com/guides/binary/blob-to-string.md) - [将 Blob 转换为 Uint8Array](https://bun.zhcndoc.com/guides/binary/blob-to-typedarray.md) - [将 Buffer 转换为 ArrayBuffer](https://bun.zhcndoc.com/guides/binary/buffer-to-arraybuffer.md) - [将 Buffer 转换为 Blob](https://bun.zhcndoc.com/guides/binary/buffer-to-blob.md) - [将 Buffer 转换为 ReadableStream](https://bun.zhcndoc.com/guides/binary/buffer-to-readablestream.md) - [将 Buffer 转换为字符串](https://bun.zhcndoc.com/guides/binary/buffer-to-string.md) - [将 Buffer 转换为 Uint8Array](https://bun.zhcndoc.com/guides/binary/buffer-to-typedarray.md) - [将 DataView 转换为字符串](https://bun.zhcndoc.com/guides/binary/dataview-to-string.md) - [将 Uint8Array 转换为 ArrayBuffer](https://bun.zhcndoc.com/guides/binary/typedarray-to-arraybuffer.md) - [将 Uint8Array 转换为 Blob](https://bun.zhcndoc.com/guides/binary/typedarray-to-blob.md) - [将 Uint8Array 转换为 Buffer](https://bun.zhcndoc.com/guides/binary/typedarray-to-buffer.md) - [将 Uint8Array 转换为 DataView](https://bun.zhcndoc.com/guides/binary/typedarray-to-dataview.md) - [将 Uint8Array 转换为 ReadableStream](https://bun.zhcndoc.com/guides/binary/typedarray-to-readablestream.md) - [将 Uint8Array 转换为字符串](https://bun.zhcndoc.com/guides/binary/typedarray-to-string.md) - [在 AWS Lambda 上部署 Bun 应用](https://bun.zhcndoc.com/guides/deployment/aws-lambda.md) - [在 DigitalOcean 上部署 Bun 应用](https://bun.zhcndoc.com/guides/deployment/digital-ocean.md) - [在 Google Cloud Run 上部署 Bun 应用](https://bun.zhcndoc.com/guides/deployment/google-cloud-run.md) - [在 Railway 上部署 Bun 应用](https://bun.zhcndoc.com/guides/deployment/railway.md): 通过本分步指南使用 CLI 和仪表盘方法部署 Bun 应用,涵盖可选的 PostgreSQL 设置和自动 SSL 配置。 - [在 Render 上部署 Bun 应用](https://bun.zhcndoc.com/guides/deployment/render.md) - [在 Vercel 上部署 Bun 应用](https://bun.zhcndoc.com/guides/deployment/vercel.md) - [使用 Astro 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/astro.md) - [创建一个 Discord 机器人](https://bun.zhcndoc.com/guides/ecosystem/discordjs.md) - [使用 Docker 容器化 Bun 应用程序](https://bun.zhcndoc.com/guides/ecosystem/docker.md) - [在 Bun 中使用 Drizzle ORM](https://bun.zhcndoc.com/guides/ecosystem/drizzle.md) - [使用 Elysia 和 Bun 构建 HTTP 服务器](https://bun.zhcndoc.com/guides/ecosystem/elysia.md) - [使用 Express 和 Bun 构建 HTTP 服务器](https://bun.zhcndoc.com/guides/ecosystem/express.md) - [在 Bun 中使用 Gel](https://bun.zhcndoc.com/guides/ecosystem/gel.md) - [使用 Hono 和 Bun 构建 HTTP 服务器](https://bun.zhcndoc.com/guides/ecosystem/hono.md) - [使用 Mongoose 和 Bun 读写 MongoDB 数据](https://bun.zhcndoc.com/guides/ecosystem/mongoose.md) - [使用 Drizzle ORM 连接 Neon Postgres](https://bun.zhcndoc.com/guides/ecosystem/neon-drizzle.md) - [使用 Neon 的无服务器 Postgres 结合 Bun](https://bun.zhcndoc.com/guides/ecosystem/neon-serverless-postgres.md) - [使用 Next.js 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/nextjs.md) - [使用 Nuxt 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/nuxt.md) - [使用 PM2 作为守护进程运行 Bun](https://bun.zhcndoc.com/guides/ecosystem/pm2.md) - [在 Bun 中使用 Prisma](https://bun.zhcndoc.com/guides/ecosystem/prisma.md) - [在 Bun 中使用 Prisma Postgres](https://bun.zhcndoc.com/guides/ecosystem/prisma-postgres.md) - [使用 Qwik 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/qwik.md) - [使用 Bun 构建 React 应用](https://bun.zhcndoc.com/guides/ecosystem/react.md) - [使用 Remix 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/remix.md) - [在 Bun 应用中添加 Sentry](https://bun.zhcndoc.com/guides/ecosystem/sentry.md) - [使用 SolidStart 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/solidstart.md) - [服务器端渲染(SSR)React 组件](https://bun.zhcndoc.com/guides/ecosystem/ssr-react.md) - [使用 StricJS 和 Bun 构建 HTTP 服务器](https://bun.zhcndoc.com/guides/ecosystem/stric.md) - [使用 SvelteKit 和 Bun 构建应用](https://bun.zhcndoc.com/guides/ecosystem/sveltekit.md) - [使用 systemd 将 Bun 作为守护进程运行](https://bun.zhcndoc.com/guides/ecosystem/systemd.md) - [使用 Bun 启动 TanStack Start](https://bun.zhcndoc.com/guides/ecosystem/tanstack-start.md) - [使用 Bun 连接 Upstash Redis](https://bun.zhcndoc.com/guides/ecosystem/upstash.md) - [使用 Vite 和 Bun 构建前端](https://bun.zhcndoc.com/guides/ecosystem/vite.md) - [使用 HTMLRewriter 提取网页中的链接](https://bun.zhcndoc.com/guides/html-rewriter/extract-links.md) - [提取社交分享图片和开放图谱标签](https://bun.zhcndoc.com/guides/html-rewriter/extract-social-meta.md) - [启动 HTTP 服务器集群](https://bun.zhcndoc.com/guides/http/cluster.md): 通过 "reusePort" 选项并发运行多个 HTTP 服务器,实现多个进程共享同一端口 - [使用 fetch 发送 HTTP 请求](https://bun.zhcndoc.com/guides/http/fetch.md) - [在 Bun 中通过 unix 域套接字进行 fetch](https://bun.zhcndoc.com/guides/http/fetch-unix.md) - [使用 FormData 通过 HTTP 上传文件](https://bun.zhcndoc.com/guides/http/file-uploads.md) - [热重载 HTTP 服务器](https://bun.zhcndoc.com/guides/http/hot.md) - [使用 fetch() 代理 HTTP 请求](https://bun.zhcndoc.com/guides/http/proxy.md) - [常见的 HTTP 服务器用法](https://bun.zhcndoc.com/guides/http/server.md) - [编写一个简单的 HTTP 服务器](https://bun.zhcndoc.com/guides/http/simple.md) - [使用 Bun 的服务器发送事件(SSE)](https://bun.zhcndoc.com/guides/http/sse.md) - [将文件作为 HTTP 响应流式传输](https://bun.zhcndoc.com/guides/http/stream-file.md) - [使用异步迭代器的流式 HTTP 服务器](https://bun.zhcndoc.com/guides/http/stream-iterator.md) - [使用 Node.js 流的流式 HTTP 服务器](https://bun.zhcndoc.com/guides/http/stream-node-streams-in-bun.md) - [在 HTTP 服务器上配置 TLS](https://bun.zhcndoc.com/guides/http/tls.md) - [指南](https://bun.zhcndoc.com/guides/index.md): 一系列使用 Bun 执行常见任务的代码示例和操作演练。 - [添加依赖](https://bun.zhcndoc.com/guides/install/add.md) - [添加开发依赖](https://bun.zhcndoc.com/guides/install/add-dev.md) - [添加 Git 依赖](https://bun.zhcndoc.com/guides/install/add-git.md) - [添加可选依赖](https://bun.zhcndoc.com/guides/install/add-optional.md) - [添加一个 peer 依赖](https://bun.zhcndoc.com/guides/install/add-peer.md) - [添加一个 tarball 依赖](https://bun.zhcndoc.com/guides/install/add-tarball.md) - [使用 bun install 配合 Azure Artifacts npm 注册表](https://bun.zhcndoc.com/guides/install/azure-artifacts.md) - [在 GitHub Actions 中使用 Bun 安装依赖](https://bun.zhcndoc.com/guides/install/cicd.md) - [覆盖 bun install 的默认 npm registry](https://bun.zhcndoc.com/guides/install/custom-registry.md) - [从 npm install 迁移到 bun install](https://bun.zhcndoc.com/guides/install/from-npm-install-to-bun-install.md) - [配置 git 以比较 Bun 的 lockb 锁文件](https://bun.zhcndoc.com/guides/install/git-diff-bun-lockfile.md) - [使用 bun install 配合 Artifactory](https://bun.zhcndoc.com/guides/install/jfrog-artifactory.md) - [以不同名称安装包](https://bun.zhcndoc.com/guides/install/npm-alias.md) - [使用 bun install 为组织作用域配置私有注册表](https://bun.zhcndoc.com/guides/install/registry-scope.md) - [添加受信任的依赖](https://bun.zhcndoc.com/guides/install/trusted.md) - [使用 workspaces 配置 monorepo](https://bun.zhcndoc.com/guides/install/workspaces.md) - [生成兼容 yarn 的锁文件](https://bun.zhcndoc.com/guides/install/yarnlock.md) - [解析命令行参数](https://bun.zhcndoc.com/guides/process/argv.md) - [监听 CTRL+C](https://bun.zhcndoc.com/guides/process/ctrl-c.md) - [派生子进程并使用 IPC 通信](https://bun.zhcndoc.com/guides/process/ipc.md) - [以纳秒为单位获取进程运行时间](https://bun.zhcndoc.com/guides/process/nanoseconds.md) - [监听操作系统信号](https://bun.zhcndoc.com/guides/process/os-signals.md) - [启动子进程](https://bun.zhcndoc.com/guides/process/spawn.md) - [从子进程读取 stderr](https://bun.zhcndoc.com/guides/process/spawn-stderr.md) - [从子进程读取标准输出](https://bun.zhcndoc.com/guides/process/spawn-stdout.md) - [从 stdin 读取](https://bun.zhcndoc.com/guides/process/stdin.md) - [读取文件到 ArrayBuffer](https://bun.zhcndoc.com/guides/read-file/arraybuffer.md) - [读取文件到 Buffer](https://bun.zhcndoc.com/guides/read-file/buffer.md) - [检查文件是否存在](https://bun.zhcndoc.com/guides/read-file/exists.md) - [读取 JSON 文件](https://bun.zhcndoc.com/guides/read-file/json.md) - [获取文件的 MIME 类型](https://bun.zhcndoc.com/guides/read-file/mime.md) - [以 ReadableStream 读取文件](https://bun.zhcndoc.com/guides/read-file/stream.md) - [将文件作为字符串读取](https://bun.zhcndoc.com/guides/read-file/string.md) - [读取文件到 Uint8Array](https://bun.zhcndoc.com/guides/read-file/uint8array.md) - [监视目录变化](https://bun.zhcndoc.com/guides/read-file/watch.md) - [使用 --define 实现构建时常量](https://bun.zhcndoc.com/guides/runtime/build-time-constants.md) - [在 GitHub Actions 中安装并运行 Bun](https://bun.zhcndoc.com/guides/runtime/cicd.md) - [在 macOS 上为单文件 JavaScript 可执行文件进行代码签名](https://bun.zhcndoc.com/guides/runtime/codesign-macos-executable.md): 解决运行 JavaScript 可执行文件时出现的“无法打开,因为来自未识别的开发者”Gatekeeper 警告。 - [定义并替换静态全局变量和常量](https://bun.zhcndoc.com/guides/runtime/define-constant.md) - [删除目录](https://bun.zhcndoc.com/guides/runtime/delete-directory.md) - [删除文件](https://bun.zhcndoc.com/guides/runtime/delete-file.md) - [使用 V8 堆快照检查内存使用情况](https://bun.zhcndoc.com/guides/runtime/heap-snapshot.md) - [将 HTML 文件作为文本导入](https://bun.zhcndoc.com/guides/runtime/import-html.md) - [导入 JSON 文件](https://bun.zhcndoc.com/guides/runtime/import-json.md) - [Import a JSON5 file](https://bun.zhcndoc.com/guides/runtime/import-json5.md) - [导入 TOML 文件](https://bun.zhcndoc.com/guides/runtime/import-toml.md) - [导入 YAML 文件](https://bun.zhcndoc.com/guides/runtime/import-yaml.md) - [读取环境变量](https://bun.zhcndoc.com/guides/runtime/read-env.md) - [设置环境变量](https://bun.zhcndoc.com/guides/runtime/set-env.md) - [运行 Shell 命令](https://bun.zhcndoc.com/guides/runtime/shell.md) - [在 Bun 中设置时区](https://bun.zhcndoc.com/guides/runtime/timezone.md) - [重新映射导入路径](https://bun.zhcndoc.com/guides/runtime/tsconfig-paths.md) - [为 Bun 安装 TypeScript 声明文件](https://bun.zhcndoc.com/guides/runtime/typescript.md) - [使用 VS Code 扩展调试 Bun](https://bun.zhcndoc.com/guides/runtime/vscode-debugger.md) - [使用网页调试器调试 Bun](https://bun.zhcndoc.com/guides/runtime/web-debugger.md) - [将 Node.js Readable 转换为 ArrayBuffer](https://bun.zhcndoc.com/guides/streams/node-readable-to-arraybuffer.md) - [将 Node.js Readable 转换为 Blob](https://bun.zhcndoc.com/guides/streams/node-readable-to-blob.md) - [将 Node.js Readable 转换为 JSON](https://bun.zhcndoc.com/guides/streams/node-readable-to-json.md) - [将 Node.js Readable 转换为字符串](https://bun.zhcndoc.com/guides/streams/node-readable-to-string.md) - [将 Node.js Readable 转换为 Uint8Array](https://bun.zhcndoc.com/guides/streams/node-readable-to-uint8array.md) - [将 ReadableStream 转换为块数组](https://bun.zhcndoc.com/guides/streams/to-array.md) - [将 ReadableStream 转换为 ArrayBuffer](https://bun.zhcndoc.com/guides/streams/to-arraybuffer.md) - [将 ReadableStream 转换为 Blob](https://bun.zhcndoc.com/guides/streams/to-blob.md) - [将 ReadableStream 转换为 Buffer](https://bun.zhcndoc.com/guides/streams/to-buffer.md) - [将 ReadableStream 转换为 JSON](https://bun.zhcndoc.com/guides/streams/to-json.md) - [将 ReadableStream 转换为字符串](https://bun.zhcndoc.com/guides/streams/to-string.md) - [将 ReadableStream 转换为 Uint8Array](https://bun.zhcndoc.com/guides/streams/to-typedarray.md) - [使用 Bun 测试运行器提前中止](https://bun.zhcndoc.com/guides/test/bail.md) - [使用通配符模式有选择地并发运行测试](https://bun.zhcndoc.com/guides/test/concurrent-test-glob.md): 设置通配符模式以决定来自哪些文件的哪些测试并行运行 - [使用 Bun 测试运行器生成代码覆盖率报告](https://bun.zhcndoc.com/guides/test/coverage.md) - [使用 Bun 测试运行器设置代码覆盖率阈值](https://bun.zhcndoc.com/guides/test/coverage-threshold.md) - [使用 Bun 和 happy-dom 编写浏览器 DOM 测试](https://bun.zhcndoc.com/guides/test/happy-dom.md) - [从 Jest 迁移到 Bun 的测试运行器](https://bun.zhcndoc.com/guides/test/migrate-from-jest.md) - [在 Bun 的测试运行器中设置系统时间](https://bun.zhcndoc.com/guides/test/mock-clock.md) - [在 `bun test` 中使用模拟函数](https://bun.zhcndoc.com/guides/test/mock-functions.md) - [使用 Bun 测试运行器多次重新运行测试](https://bun.zhcndoc.com/guides/test/rerun-each.md) - [使用 Bun 测试运行器运行测试](https://bun.zhcndoc.com/guides/test/run-tests.md) - [使用 Bun 测试运行器跳过测试](https://bun.zhcndoc.com/guides/test/skip-tests.md) - [在 `bun test` 中使用快照测试](https://bun.zhcndoc.com/guides/test/snapshot.md) - [在 `bun test` 中监视方法](https://bun.zhcndoc.com/guides/test/spy-on.md) - [使用 bun test 导入、require 和测试 Svelte 组件](https://bun.zhcndoc.com/guides/test/svelte-test.md) - [在 Bun 中使用 Testing Library](https://bun.zhcndoc.com/guides/test/testing-library.md) - [使用 Bun 测试运行器设置单个测试超时](https://bun.zhcndoc.com/guides/test/timeout.md) - [使用 Bun 测试运行器将测试标记为“todo”](https://bun.zhcndoc.com/guides/test/todo-tests.md) - [在 `bun test` 中更新快照](https://bun.zhcndoc.com/guides/test/update-snapshots.md) - [使用 Bun 的监听模式运行测试](https://bun.zhcndoc.com/guides/test/watch-mode.md) - [编码和解码 base64 字符串](https://bun.zhcndoc.com/guides/util/base64.md) - [检查两个对象是否深度相等](https://bun.zhcndoc.com/guides/util/deep-equals.md) - [使用 DEFLATE 进行数据压缩和解压](https://bun.zhcndoc.com/guides/util/deflate.md) - [检测代码何时在 Bun 中执行](https://bun.zhcndoc.com/guides/util/detect-bun.md) - [检查当前文件是否为入口点](https://bun.zhcndoc.com/guides/util/entrypoint.md) - [转义 HTML 字符串](https://bun.zhcndoc.com/guides/util/escape-html.md) - [将文件 URL 转换为绝对路径](https://bun.zhcndoc.com/guides/util/file-url-to-path.md) - [使用 gzip 压缩和解压数据](https://bun.zhcndoc.com/guides/util/gzip.md) - [对密码进行哈希](https://bun.zhcndoc.com/guides/util/hash-a-password.md) - [获取当前文件的目录](https://bun.zhcndoc.com/guides/util/import-meta-dir.md) - [获取当前文件的文件名](https://bun.zhcndoc.com/guides/util/import-meta-file.md) - [获取当前文件的绝对路径](https://bun.zhcndoc.com/guides/util/import-meta-path.md) - [生成 UUID](https://bun.zhcndoc.com/guides/util/javascript-uuid.md) - [获取当前入口文件的绝对路径](https://bun.zhcndoc.com/guides/util/main.md) - [将绝对路径转换为文件 URL](https://bun.zhcndoc.com/guides/util/path-to-file-url.md) - [固定毫秒数的休眠](https://bun.zhcndoc.com/guides/util/sleep.md) - [升级 Bun 到最新版本](https://bun.zhcndoc.com/guides/util/upgrade.md) - [获取当前 Bun 版本](https://bun.zhcndoc.com/guides/util/version.md) - [获取可执行二进制文件的路径](https://bun.zhcndoc.com/guides/util/which-path-to-executable-bin.md) - [启用 WebSocket 消息压缩](https://bun.zhcndoc.com/guides/websocket/compression.md) - [在 WebSocket 上设置每个 socket 的上下文数据](https://bun.zhcndoc.com/guides/websocket/context.md) - [构建一个发布-订阅 WebSocket 服务器](https://bun.zhcndoc.com/guides/websocket/pubsub.md) - [构建一个简单的 WebSocket 服务器](https://bun.zhcndoc.com/guides/websocket/simple.md) - [追加内容到文件](https://bun.zhcndoc.com/guides/write-file/append.md) - [将字符串写入文件](https://bun.zhcndoc.com/guides/write-file/basic.md) - [将 Blob 写入文件](https://bun.zhcndoc.com/guides/write-file/blob.md) - [写入文件到标准输出](https://bun.zhcndoc.com/guides/write-file/cat.md) - [将文件复制到另一个位置](https://bun.zhcndoc.com/guides/write-file/file-cp.md) - [递增写入文件](https://bun.zhcndoc.com/guides/write-file/filesink.md) - [将 Response 写入文件](https://bun.zhcndoc.com/guides/write-file/response.md) - [写入到标准输出](https://bun.zhcndoc.com/guides/write-file/stdout.md) - [将 ReadableStream 写入文件](https://bun.zhcndoc.com/guides/write-file/stream.md) - [删除文件](https://bun.zhcndoc.com/guides/write-file/unlink.md) - [欢迎使用 Bun](https://bun.zhcndoc.com/index.md): Bun 是一个用于开发现代 JavaScript/TypeScript 应用的一体化工具包。 - [安装](https://bun.zhcndoc.com/installation.md): 通过 npm、Homebrew、Docker 或官方脚本安装 Bun。 - [bunx](https://bun.zhcndoc.com/pm/bunx.md): 运行 npm 包 - [目录](https://bun.zhcndoc.com/pm/catalogs.md): 在 monorepo 中跨多个包共享通用依赖版本 - [bun add](https://bun.zhcndoc.com/pm/cli/add.md): 使用 Bun 的快速包管理器向您的项目添加包 - [bun audit](https://bun.zhcndoc.com/pm/cli/audit.md): 检查已安装的包是否存在已知的安全漏洞 - [bun info](https://bun.zhcndoc.com/pm/cli/info.md): 显示来自 npm 注册表的包元数据 - [bun install](https://bun.zhcndoc.com/pm/cli/install.md): 使用 Bun 的快速包管理器安装包 - [bun link](https://bun.zhcndoc.com/pm/cli/link.md): 链接本地包以便开发 - [bun outdated](https://bun.zhcndoc.com/pm/cli/outdated.md): 检查过期的依赖 - [bun 补丁](https://bun.zhcndoc.com/pm/cli/patch.md): 以对 git 友好的方式持久化修补 node_modules 包 - [bun pm](https://bun.zhcndoc.com/pm/cli/pm.md): 包管理器工具 - [bun publish](https://bun.zhcndoc.com/pm/cli/publish.md): 使用 `bun publish` 将包发布到 npm 注册表 - [bun remove](https://bun.zhcndoc.com/pm/cli/remove.md): 从你的项目中移除依赖 - [bun upgrade](https://bun.zhcndoc.com/pm/cli/update.md): 将依赖项更新到最新版本 - [bun why](https://bun.zhcndoc.com/pm/cli/why.md): 解释为什么安装了某个包 - [bun --filter](https://bun.zhcndoc.com/pm/filter.md): 使用 --filter 标志在 monorepo 中按模式选择包 - [全局缓存](https://bun.zhcndoc.com/pm/global-cache.md): Bun 如何在全局缓存中存储和管理包 - [全局虚拟存储](https://bun.zhcndoc.com/pm/global-store.md): 只安装一次。每个项目都链接到同一份副本。 - [隔离安装](https://bun.zhcndoc.com/pm/isolated-installs.md): 与 pnpm 方法类似的严格依赖隔离 - [生命周期脚本](https://bun.zhcndoc.com/pm/lifecycle.md): Bun 如何安全地处理包的生命周期脚本 - [锁文件](https://bun.zhcndoc.com/pm/lockfile.md): Bun 的锁文件格式和配置 - [.npmrc 支持](https://bun.zhcndoc.com/pm/npmrc.md) - [覆盖与解析](https://bun.zhcndoc.com/pm/overrides.md): 使用 npm 的 overrides 和 Yarn 的 resolutions 控制元依赖版本 - [作用域和注册表](https://bun.zhcndoc.com/pm/scopes-registries.md): 配置私有注册表和作用域包 - [安全扫描器 API](https://bun.zhcndoc.com/pm/security-scanner-api.md) - [工作区](https://bun.zhcndoc.com/pm/workspaces.md): 开发包含多个独立包的复杂多包仓库(monorepo) - [性能基准测试](https://bun.zhcndoc.com/project/benchmarking.md): 如何对 Bun 进行基准测试 - [Bindgen](https://bun.zhcndoc.com/project/bindgen.md): Bun 的 Bindgen - [在 Windows 上构建](https://bun.zhcndoc.com/project/building-windows.md): 在 Windows 上构建 Bun - [贡献](https://bun.zhcndoc.com/project/contributing.md): 贡献给 Bun - [许可证](https://bun.zhcndoc.com/project/license.md): Bun 的许可证 - [路线图](https://bun.zhcndoc.com/project/roadmap.md): Bun 的路线图和长期计划 - [快速开始](https://bun.zhcndoc.com/quickstart.md): 使用 Bun 构建您的第一个应用 - [归档](https://bun.zhcndoc.com/runtime/archive.md): 通过 Bun 的快速本地实现创建和解压 tar 归档文件 - [自动安装](https://bun.zhcndoc.com/runtime/auto-install.md): Bun 的自动包安装功能,用于独立脚本执行 - [二进制数据](https://bun.zhcndoc.com/runtime/binary-data.md): 在 JavaScript 中处理二进制数据 - [Bun API](https://bun.zhcndoc.com/runtime/bun-apis.md): Bun 全局对象和内置模块中可用的 Bun 原生 API 概述 - [bunfig.toml](https://bun.zhcndoc.com/runtime/bunfig.md): 使用配置文件 bunfig.toml 配置 Bun 的行为 - [C 编译器](https://bun.zhcndoc.com/runtime/c-compiler.md): 使用低开销从 JavaScript 编译和运行 C 代码 - [Spawn](https://bun.zhcndoc.com/runtime/child-process.md): 使用 `Bun.spawn` 或 `Bun.spawnSync` 创建子进程 - [颜色](https://bun.zhcndoc.com/runtime/color.md): 将颜色格式化为 CSS、ANSI、数字、十六进制字符串等多种格式 - [console](https://bun.zhcndoc.com/runtime/console.md): Bun 中的 console 对象 - [Cookies](https://bun.zhcndoc.com/runtime/cookies.md): 使用 Bun 的原生 API 处理 HTTP Cookie - [Cron](https://bun.zhcndoc.com/runtime/cron.md): 使用 Bun 调度和解析 cron 任务 - [CSRF 防护](https://bun.zhcndoc.com/runtime/csrf.md): 使用 Bun 的内置 API 生成和验证 CSRF 令牌 - [调试](https://bun.zhcndoc.com/runtime/debugger.md): 使用 WebKit Inspector 协议,通过交互式调试器调试你的 Bun 代码 - [环境变量](https://bun.zhcndoc.com/runtime/environment-variables.md): 在 Bun 中读取和配置环境变量,包括自动支持 .env 文件 - [FFI](https://bun.zhcndoc.com/runtime/ffi.md): 使用 Bun 的 FFI 模块高效地从 JavaScript 调用本地库 - [文件 I/O](https://bun.zhcndoc.com/runtime/file-io.md): Bun 提供了一组经过优化的 API 用于读取和写入文件。 - [文件系统路由器](https://bun.zhcndoc.com/runtime/file-system-router.md): Bun 提供了一个快速的 API 用于根据文件系统路径解析路由 - [文件类型](https://bun.zhcndoc.com/runtime/file-types.md): Bun 的打包器和运行时支持的文件类型和加载器 - [Glob](https://bun.zhcndoc.com/runtime/glob.md): 使用 Bun 的快速本地文件匹配实现 - [全局变量](https://bun.zhcndoc.com/runtime/globals.md): 使用 Bun 的全局对象 - [哈希](https://bun.zhcndoc.com/runtime/hashing.md): Bun 提供了一套使用多种密码学安全算法进行密码哈希和验证的实用函数 - [HTMLRewriter](https://bun.zhcndoc.com/runtime/html-rewriter.md): 使用 Bun 的 HTMLRewriter 通过 CSS 选择器转换 HTML 文档 - [Cookies](https://bun.zhcndoc.com/runtime/http/cookies.md): 使用 Bun 内置的 Cookie API 处理 HTTP 请求和响应中的 cookies。 - [错误处理](https://bun.zhcndoc.com/runtime/http/error-handling.md): 学习如何在 Bun 的开发服务器中处理错误 - [指标](https://bun.zhcndoc.com/runtime/http/metrics.md): 使用内置指标监控服务器活动 - [路由](https://bun.zhcndoc.com/runtime/http/routing.md): 在 `Bun.serve` 中使用静态路径、参数和通配符定义路由 - [服务器](https://bun.zhcndoc.com/runtime/http/server.md): 使用 `Bun.serve` 在 Bun 中启动高性能 HTTP 服务器 - [TLS](https://bun.zhcndoc.com/runtime/http/tls.md): 在 Bun.serve 中启用 TLS - [WebSockets](https://bun.zhcndoc.com/runtime/http/websockets.md): Bun 中的服务器端 WebSockets - [图像](https://bun.zhcndoc.com/runtime/image.md): 使用快速的原生管道解码、转换和编码图像 - [Bun 运行时](https://bun.zhcndoc.com/runtime/index.md): 使用 Bun 的快速运行时执行 JavaScript/TypeScript 文件、package.json 脚本及可执行程序包。 - [JSON5](https://bun.zhcndoc.com/runtime/json5.md): 通过运行时 API 和打包工具集成,使用 Bun 内置对 JSON5 文件的支持 - [JSONL](https://bun.zhcndoc.com/runtime/jsonl.md): 使用 Bun 内置的流式解析器解析换行分隔的 JSON(JSONL) - [JSX](https://bun.zhcndoc.com/runtime/jsx.md): Bun 内置的 JSX 和 TSX 支持,具有可配置的转译选项 - [Markdown](https://bun.zhcndoc.com/runtime/markdown.md): 使用 Bun 内置的 Markdown API 解析并渲染 Markdown,支持 GFM 扩展和自定义渲染回调 - [模块解析](https://bun.zhcndoc.com/runtime/module-resolution.md): Bun 如何解析模块以及处理 JavaScript 和 TypeScript 中的导入 - [DNS](https://bun.zhcndoc.com/runtime/networking/dns.md): 使用 Bun 的 DNS 模块解析 DNS 记录 - [Fetch](https://bun.zhcndoc.com/runtime/networking/fetch.md): 使用 Bun 的 fetch API 发送 HTTP 请求 - [TCP](https://bun.zhcndoc.com/runtime/networking/tcp.md): 使用 Bun 的原生 TCP API 实现性能敏感的系统,如数据库客户端、游戏服务器,或任何需要通过 TCP(而非 HTTP)通信的应用 - [UDP](https://bun.zhcndoc.com/runtime/networking/udp.md): 使用 Bun 的 UDP API 实现具有高级实时需求的服务,例如语音聊天。 - [Node-API](https://bun.zhcndoc.com/runtime/node-api.md): 使用 Bun 的 Node-API 模块构建 Node.js 的原生插件 - [Node.js 兼容性](https://bun.zhcndoc.com/runtime/nodejs-compat.md): Bun 对 Node.js API、模块和全局变量的兼容状态 - [插件](https://bun.zhcndoc.com/runtime/plugins.md): 用于扩展 Bun 运行时和打包器的通用插件 API - [Redis](https://bun.zhcndoc.com/runtime/redis.md): 使用 Bun 原生 Redis 客户端,基于 Promise 的 API - [REPL](https://bun.zhcndoc.com/runtime/repl.md): 一个带语法高亮、历史记录和自动补全功能的交互式 JavaScript 和 TypeScript REPL - [S3](https://bun.zhcndoc.com/runtime/s3.md): Bun 提供了快速的原生绑定,用于与兼容 S3 的对象存储服务交互。 - [Secrets](https://bun.zhcndoc.com/runtime/secrets.md): 使用 Bun 的 Secrets API 安全存储和检索敏感凭据 - [语义化版本](https://bun.zhcndoc.com/runtime/semver.md): 使用 Bun 的语义化版本 API - [Shell](https://bun.zhcndoc.com/runtime/shell.md): 使用 Bun 的 shell 脚本 API 从 JavaScript 运行 shell 命令 - [SQL](https://bun.zhcndoc.com/runtime/sql.md): Bun 提供原生绑定,通过统一的基于 Promise 的 API 来操作 SQL 数据库,支持 PostgreSQL、MySQL 和 SQLite。 - [SQLite](https://bun.zhcndoc.com/runtime/sqlite.md): Bun 内置了高性能的 SQLite3 驱动。 - [Streams](https://bun.zhcndoc.com/runtime/streams.md): 使用 Bun 的流 API 以无需一次性加载全部数据到内存中即可处理二进制数据 - [bun create](https://bun.zhcndoc.com/runtime/templating/create.md): 从 React 组件、`create-