UNPKG

bun-types

Version:

Type definitions and documentation for Bun, an incredibly fast JavaScript runtime

46 lines (35 loc) 886 B
--- title: Add a peer dependency sidebarTitle: Add a peer dependency mode: center --- To add an npm package as a peer dependency, use the `--peer` flag. ```sh terminal icon="terminal" bun add @types/bun --peer ``` --- This will add the package to `peerDependencies` in `package.json`. ```json package.json icon="file-json" { "peerDependencies": { "@types/bun": "^1.3.3" // [!code ++] } } ``` --- Running `bun install` will install peer dependencies by default, unless marked optional in `peerDependenciesMeta`. {/* prettier-ignore */} ```json package.json icon="file-json" { "peerDependencies": { "@types/bun": "^1.3.3" }, "peerDependenciesMeta": { "@types/bun": { // [!code ++] "optional": true // [!code ++] } // [!code ++] } } ``` --- See [Docs > Package manager](/docs/pm/cli/install) for complete documentation of Bun's package manager.