Cross-package-manager executor - automatically detects and runs the right package manager (npm, yarn, pnpm, or bun) based on your project's lock files.
Tired of remembering which package manager each project uses? xpm detects it automatically by looking for lock files and runs the appropriate command.
npm install -g x-package-managercurl -o xpm https://raw.githubusercontent.com/janicduplessis/xpm/main/bin/xpm.sh
chmod +x xpm
mv xpm /usr/local/bin/Use xpm exactly as you would use npm, yarn, pnpm, or bun:
# Install dependencies
xpm install
# Add a package
xpm add react
# Run scripts
xpm run build
xpm test
# Any other command
xpm --versionxpm walks up the directory tree from your current location looking for lock files:
bun.lockb→ uses bunpnpm-lock.yaml→ uses pnpmyarn.lock→ uses yarnpackage-lock.json→ uses npm
If no lock file is found, it defaults to npm.
- Bash (included on macOS and Linux)
- At least one of: npm, yarn, pnpm, or bun installed
MIT