Compare commits

...

3 Commits

Author SHA1 Message Date
Claude Bot
54890effd0 docs: Simplify .bunx documentation 2025-09-17 08:39:20 +00:00
Claude Bot
49d502341c refactor: Move .bunx docs from bun run to bun install, expand coverage
- Removed .bunx section from bun run docs (keep it focused on running scripts)
- Significantly expanded .bunx documentation in bun install docs
- Now properly explains how bin linking works during package installation
- Added detailed explanation of how .bunx files are created during install
- Better structured with subsections for clarity
- Emphasizes this is a package installation feature, not just runtime

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 08:36:24 +00:00
Claude Bot
8adf0962e9 docs: Add documentation for .bunx files on Windows
This adds comprehensive documentation explaining the .bunx file format
used on Windows for package executables. The documentation covers:

- Why .bunx files were created (symlink limitations, shebang issues, etc.)
- Performance benefits (11x faster than npm run/npx)
- Developer experience improvements (no "Terminate batch job?" prompts)
- Cross-compatibility with both Bun and Node.js

Added to both the `bun run` CLI docs and install docs to ensure users
understand this Windows-specific feature.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 08:31:50 +00:00

View File

@@ -202,6 +202,31 @@ To remove a dependency:
$ bun remove preact
```
## Package executables
When packages define executables in their `"bin"` field, Bun creates links in `node_modules/.bin`.
### `.bunx` files on Windows
On Windows, `bun install` creates `.bunx` files instead of symlinks for package executables.
The `.bunx` file is a cross-filesystem symlink that starts scripts with Bun or Node.js. We created this because:
- Symlinks aren't guaranteed to work on Windows
- Windows doesn't read shebangs (`#!/usr/bin/env bun`)
- Avoids creating multiple wrapper files (`.cmd`, `.sh`, `.ps1`)
- Eliminates "Terminate batch job? (Y/n)" prompts
Performance: `bun run` is 11x faster than `npm run`, `bunx` is 11x faster than `npx`.
{% image src="/images/bun-run-on-windows.png" caption="Time spent running `bunx cowsay` vs `npx cowsay` on Windows." /%}
Even if you only use Bun as a package manager, `.bunx` works with Node.js.
{% image src="/images/terminate-batch-job-bun.gif" /%}
{% image src="/images/terminate-batch-job-npm.gif" /%}
## Git dependencies
To add a dependency from a git repository: