mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
Add `bun prune` command that removes extraneous packages from node_modules that are not declared as dependencies in package.json or referenced in the lockfile. This implementation follows the behavior of `npm prune` and `pnpm prune`: - Removes packages not listed in dependencies/devDependencies - Handles both regular packages and scoped packages (@scope/package) - Preserves legitimate packages that are in the lockfile - Provides helpful error messages for missing package.json/lockfile - Gracefully handles missing node_modules directory Features: - CLI integration with help text via `bun prune --help` - Progress reporting when removing packages - Proper error handling and user feedback - Cross-platform compatibility using Bun's filesystem utilities 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>