mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Add ecosystem guides (#3847)
* Add ecosystem guides * Update titles * Rename stric * Add unlink and fetch guides * Add formdata guide * Tweak title * Moar
This commit is contained in:
25
docs/guides/install/add-optional.md
Normal file
25
docs/guides/install/add-optional.md
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: Add an optional dependency
|
||||
---
|
||||
|
||||
To add an npm package as a peer dependency, use the `--optional` flag.
|
||||
|
||||
```sh
|
||||
$ bun add zod --optional
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
This will add the package to `optionalDependencies` in `package.json`.
|
||||
|
||||
```json-diff
|
||||
{
|
||||
"optionalDependencies": {
|
||||
+ "zod": "^3.0.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
See [Docs > Package manager](/docs/cli/install) for complete documentation of Bun's package manager.
|
||||
Reference in New Issue
Block a user