Detection Priority
Pumu automatically detects the package manager in each project by scanning for specific lockfiles and manifest files. The detection happens in a priority order to handle projects with multiple package managers.Priority Order
When multiple lockfiles exist in the same directory, Pumu uses this priority order (fromdetector.go:28-37):
- Bun -
bun.lockborbun.lock - pnpm -
pnpm-lock.yaml - Yarn -
yarn.lock - npm -
package-lock.json - Deno -
deno.jsonordeno.jsonc - Cargo -
Cargo.toml - Go -
go.mod - Pip -
requirements.txtorpyproject.toml
The priority order ensures that if you have both
package-lock.json and pnpm-lock.yaml in the same directory, Pumu will recognize it as a pnpm project.Supported Package Managers
JavaScript/TypeScript Ecosystems
- npm
- pnpm
- Yarn
- Bun
- Deno
Detection Files:
package-lock.json
node_modules/
- 50-500+ MB
Other Languages
- Rust (Cargo)
- Go
- Python (Pip)
Detection Files:
Cargo.toml
target/
- 100-2000+ MB (build artifacts and dependencies)
Dependency Folders by Package Manager
Pumu tracks these dependency and build folders (fromscanner.go:34-37):
| Folder | Package Manager(s) | Typical Size | Deletable |
|---|---|---|---|
node_modules | npm, pnpm, yarn, bun, deno | 50-500+ MB | ✅ |
target | cargo | 100-2000+ MB | ✅ |
.venv | pip | 50-300+ MB | ✅ |
.next | Next.js | 100-500+ MB | ✅ |
.svelte-kit | SvelteKit | 50-200+ MB | ✅ |
dist | Various build tools | 10-100+ MB | ✅ |
build | Various build tools | 10-100+ MB | ✅ |
Multi-Package Manager Projects
Monorepos
In monorepos, different packages may use different package managers. Pumu handles this by:- Per-directory detection - Each subdirectory is scanned independently
- Separate reinstallation - Each project can be reinstalled with its own package manager
- Interactive selection - You choose which projects to reinstall
pumu sweep --reinstall, you’ll see:
Mixed Lockfiles
If a single directory contains multiple lockfiles (e.g., bothpackage-lock.json and yarn.lock), Pumu uses the priority order to select one:
What happens with npm + pnpm lockfiles?
What happens with npm + pnpm lockfiles?
If you have both
package-lock.json and pnpm-lock.yaml:- Pumu detects pnpm (higher priority)
- Runs
pnpm installduring reinstall - The
package-lock.jsonis ignored
What about framework build folders?
What about framework build folders?
Folders like
.next and .svelte-kit are always detected regardless of package manager:- They’re recognized by name, not by lockfiles
- They’re safe to delete (regenerated on build)
- They don’t affect package manager detection
Detection Algorithm
The detection logic (fromdetector.go:27-48) works as follows:
The iteration order in Go maps is deterministic in this implementation because the priority is enforced by the order of keys in the
managers map definition.Examples
Detect Package Manager in Current Directory
Scan Multi-Language Project
See Also
- Performance Guide - Learn about concurrent scanning
- Safety Features - Understand what’s protected