Bun

GuidesPackage manager

Add a peer dependency with Bun

To add an npm package as a peer dependency, use the --peer flag.

bun add @types/bun --peer

This will add the package to peerDependencies in package.json.

{
  "peerDependencies": {
    "@types/bun": "^1.1.44"
  }
}

Running bun install will install peer dependencies by default, unless marked optional in peerDependenciesMeta.

{
  "peerDependencies": {
    "@types/bun": "^1.1.44"
  },
  "peerDependenciesMeta": {
    "@types/bun": {
      "optional": true
    }
  }

}

See Docs > Package manager for complete documentation of Bun's package manager.