2025-12-16 10:20:31 -07:00
|
|
|
# bun add
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
> Add and install new dependencies to the current project.
|
2025-12-16 10:20:31 -07:00
|
|
|
> More information: <https://bun.com/docs>.
|
|
|
|
|
|
|
|
|
|
- Install a single package:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} {{package}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Install multiple packages:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} {{package1 package2 ...}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Install from a Git repository:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} {{git_url}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Install a specific version:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} {{package}}@{{version}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Install from local file or directory:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} file:{{path/to/file_or_directory}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Add a dev dependency:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} {{[-d|--dev]}} {{package}}`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Add a package globally:
|
|
|
|
|
|
2026-06-12 17:51:25 -06:00
|
|
|
`bun {{[a|add]}} {{[-g|--global]}} {{package}}`
|