mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
29 lines
509 B
Plaintext
29 lines
509 B
Plaintext
---
|
|
title: Add a development dependency
|
|
sidebarTitle: Add a dev dependency
|
|
mode: center
|
|
---
|
|
|
|
To add an npm package as a development dependency, use `bun add --development`.
|
|
|
|
```sh terminal icon="terminal"
|
|
bun add zod --dev
|
|
bun add zod -d # shorthand
|
|
```
|
|
|
|
---
|
|
|
|
This will add the package to `devDependencies` in `package.json`.
|
|
|
|
```json
|
|
{
|
|
"devDependencies": {
|
|
"zod": "^3.0.0" // [!code ++]
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
See [Docs > Package manager](/pm/cli/install) for complete documentation of Bun's package manager.
|