From d0272d4a98b18f9c91731cec2b45d5e2de81b842 Mon Sep 17 00:00:00 2001 From: Lydia Hallie Date: Tue, 2 Sep 2025 18:48:18 -0700 Subject: [PATCH] docs: add callout to Global Cache in bun install (#22351) Add a better callout linking to the Global Cache docs so users can more easily discover Bun install's disk efficiency --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- docs/cli/install.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/cli/install.md b/docs/cli/install.md index a9fb572916..0ad692ac62 100644 --- a/docs/cli/install.md +++ b/docs/cli/install.md @@ -8,6 +8,14 @@ The `bun` CLI contains a Node.js-compatible package manager designed to be a dra {% /callout %} +{% callout %} + +**💾 Disk efficient** — Bun install stores all packages in a global cache (`~/.bun/install/cache/`) and creates hardlinks (Linux) or copy-on-write clones (macOS) to `node_modules`. This means duplicate packages across projects point to the same underlying data, taking up virtually no extra disk space. + +For more details, see [Package manager > Global cache](https://bun.com/docs/install/cache). + +{% /callout %} + {% details summary="For Linux users" %} The recommended minimum Linux Kernel version is 5.6. If you're on Linux kernel 5.1 - 5.5, `bun install` will work, but HTTP requests will be slow due to a lack of support for io_uring's `connect()` operation. @@ -207,6 +215,12 @@ Isolated installs create a central package store in `node_modules/.bun/` with sy For complete documentation on isolated installs, refer to [Package manager > Isolated installs](https://bun.com/docs/install/isolated). +## Disk efficiency + +Bun uses a global cache at `~/.bun/install/cache/` to minimize disk usage. Packages are stored once and linked to `node_modules` using hardlinks (Linux/Windows) or copy-on-write (macOS), so duplicate packages across projects don't consume additional disk space. + +For complete documentation refer to [Package manager > Global cache](https://bun.com/docs/install/cache). + ## Configuration The default behavior of `bun install` can be configured in `bunfig.toml`. The default values are shown below.