> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 添加开发依赖

要将 npm 包作为开发依赖添加，请使用 `bun add --development`。

```sh terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun add zod --dev
bun add zod -d # 简写
```

***

这将把该包添加到 `package.json` 中的 `devDependencies`。

```json theme={"theme":{"light":"github-light","dark":"dracula"}}
{
  "devDependencies": {
    "zod": "^3.0.0" // [!code ++]
  }
}
```

***

完整的 Bun 包管理器文档请参见 [文档 > 包管理器](/pm/cli/install)。
