To add an npm package as an optional dependency, use theDocumentation Index
Fetch the complete documentation index at: https://bun.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
--optional flag.
terminal
This will add the package to
optionalDependencies in package.json.
package.json
See Docs > Package manager for complete documentation of Bun’s package manager.