Skip to content

Cross-package-manager executor - automatically detects and runs npm, yarn, or pnpm

Notifications You must be signed in to change notification settings

janicduplessis/xpm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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-manager

Standalone 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 --version

How It Works

xpm walks up the directory tree from your current location looking for lock files:

  • bun.lockb → uses bun
  • pnpm-lock.yaml → uses pnpm
  • yarn.lock → uses yarn
  • package-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

About

Cross-package-manager executor - automatically detects and runs npm, yarn, or pnpm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages