To add an npm package as a dependency, useDocumentation Index
Fetch the complete documentation index at: https://bun.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
bun add.
terminal
This will add the package to
dependencies in package.json. By default, the ^ range specifier will be used, to indicate that any future minor or patch versions are acceptable.
package.json
To “pin” to an exact version of the package, use
--exact. This will add the package to dependencies without the ^, pinning your project to the exact version you installed.
terminal
To specify an exact version or a tag:
terminal
See Docs > Package manager for complete documentation of Bun’s package manager.