x-package-manager
v1.1.0
Published
Cross-package-manager executor - automatically detects and runs npm, yarn, pnpm, or bun based on your project
Maintainers
Readme
xpm
Cross-package-manager executor - automatically detects and runs the right package manager (npm, yarn, pnpm, or bun) based on your project's lock files.
Why?
Tired of remembering which package manager each project uses? xpm detects it automatically by looking for lock files and runs the appropriate command.
Installation
Global Installation (Recommended)
npm install -g x-package-managerStandalone Script
curl -o xpm https://raw.githubusercontent.com/janicduplessis/xpm/main/bin/xpm.sh
chmod +x xpm
mv xpm /usr/local/bin/Usage
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 --versionHow It Works
xpm 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.
Requirements
- Bash (included on macOS and Linux)
- At least one of: npm, yarn, pnpm, or bun installed
License
MIT
