Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/pm/cli/install.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ Environment variables have a higher priority than `bunfig.toml`.
| `BUN_CONFIG_SKIP_LOAD_LOCKFILE` | Don’t load a lockfile |
| `BUN_CONFIG_SKIP_INSTALL_PACKAGES` | Don’t install any packages |

Bun always tries to use the fastest available installation method for the target platform. On macOS, that’s `clonefile` and on Linux, that’s `hardlink`. You can change which installation method is used with the `--backend` flag. When unavailable or on error, `clonefile` and `hardlink` fallsback to a platform-specific implementation of copying files.
Bun always tries to use the fastest available installation method for the target platform. On macOS, that’s `clonefile` and on Linux, that’s `hardlink`. You can change which installation method is used with the `--backend` flag. When unavailable or on error, `clonefile` and `hardlink` fall back to a platform-specific implementation of copying files.

Bun stores installed packages from npm in `~/.bun/install/cache/${name}@${version}`. Note that if the semver version has a `build` or a `pre` tag, it is replaced with a hash of that value instead. This is to reduce the chances of errors from long file paths, but unfortunately complicates figuring out where a package was installed on disk.

Expand Down Expand Up @@ -428,7 +428,7 @@ jobs:

## Platform-specific dependencies?

bun stores normalized `cpu` and `os` values from npm in the lockfile, along with the resolved packages. It skips downloading, extracting, and installing packages disabled for the current target at runtime. This means the lockfile won't change between platforms/architectures even if the packages ultimately installed do change.
Bun stores normalized `cpu` and `os` values from npm in the lockfile, along with the resolved packages. It skips downloading, extracting, and installing packages disabled for the current target at runtime. This means the lockfile won't change between platforms/architectures even if the packages ultimately installed do change.

### `--cpu` and `--os` flags

Expand Down Expand Up @@ -489,7 +489,7 @@ rm -rf node_modules
bun install --backend clonefile_each_dir
```

**`copyfile`** is the fallback used when any of the above fail, and is the slowest. on macOS, it uses `fcopyfile()` and on linux it uses `copy_file_range()`.
**`copyfile`** is the fallback used when any of the above fail, and is the slowest. On macOS, it uses `fcopyfile()` and on linux it uses `copy_file_range()`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Capitalize "Linux" for consistency with proper nouns.

The capitalization of "On macOS" is correct. For consistency and proper noun conventions, "linux" should also be capitalized as "Linux".

Proposed improvement
-**`copyfile`** is the fallback used when any of the above fail, and is the slowest. On macOS, it uses `fcopyfile()` and on linux it uses `copy_file_range()`.
+**`copyfile`** is the fallback used when any of the above fail, and is the slowest. On macOS, it uses `fcopyfile()` and on Linux it uses `copy_file_range()`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**`copyfile`** is the fallback used when any of the above fail, and is the slowest. On macOS, it uses `fcopyfile()` and on linux it uses `copy_file_range()`.
**`copyfile`** is the fallback used when any of the above fail, and is the slowest. On macOS, it uses `fcopyfile()` and on Linux it uses `copy_file_range()`.
🤖 Prompt for AI Agents
In docs/pm/cli/install.mdx around line 492, the word "linux" is not capitalized;
change "linux" to "Linux" so the sentence reads that on macOS it uses
fcopyfile() and on Linux it uses copy_file_range(), maintaining proper noun
capitalization and consistency.


```bash
rm -rf node_modules
Expand All @@ -512,7 +512,7 @@ node --preserve-symlinks ./my-file.js # https://nodejs.org/api/cli.html#--preser
Bun uses a binary format for caching NPM registry responses. This loads much faster than JSON and tends to be smaller on disk.
You will see these files in `~/.bun/install/cache/*.npm`. The filename pattern is `${hash(packageName)}.npm`. It’s a hash so that extra directories don’t need to be created for scoped packages.

Bun's usage of `Cache-Control` ignores `Age`. This improves performance, but means bun may be about 5 minutes out of date to receive the latest package version metadata from npm.
Bun's usage of `Cache-Control` ignores `Age`. This improves performance, but means Bun may be about 5 minutes out of date to receive the latest package version metadata from npm.

## pnpm migration

Expand Down