npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pmswitch

v1.0.8

Published

Zero-config CLI tool that automatically detects and uses the right package manager based on lockfiles

Readme

PMSwitch 🔄

A zero-config CLI tool that detects a project's package manager (pnpm, yarn, npm, bun) by analyzing lockfiles and proxies commands to the correct package manager. Say goodbye to manually switching between package managers in different projects!

Website: https://pmswitch.org

Features

  • Automatic Detection: Detects package managers based on lockfiles (pnpm-lock.yaml, yarn.lock, package-lock.json, bun.lockb)
  • Command Proxying: Forwards commands to the correct package manager
  • Multiple Lockfile Handling: Interactive prompts for ambiguous scenarios
  • Configuration Options: Global and project-specific settings
  • Auto-Installation: Can install missing package managers when needed

Installation

npm install -g pmswitch

From Source

git clone https://github.com/PMswitch/PMSwitch.git
cd PMSwitch
pnpm install
pnpm build
pnpm link --global

Usage

Instead of switching between different package managers in different projects, simply use pms as a universal command:

# Equivalent to "npm install", "yarn install", or "pnpm install" depending on lockfile
pms install

# Add a dependency
pms add react

# Run a script
pms run start

# Execute npx-style commands (works across all package managers)
pms exec cowsay Hello

# Execute with specific flags
pms add lodash --dev

Force a specific package manager

pms install --force-pnpm
pms add react --force-yarn
pms run build --force-npm

Disable interactive prompts

pms install --no-interactive

Show debug information

pms install --debug

Set default package manager

You can set your preferred default package manager directly from the command line:

pms --default bun  # Set bun as your default package manager
pms --default pnpm  # Set pnpm as your default package manager
pms --default yarn  # Set yarn as your default package manager
pms --default npm   # Set npm as your default package manager

Configuration

PMSwitch can be configured globally or per-project:

Global Configuration

Create a .pmswitchrc file in your home directory:

{
  "defaultPackageManager": "pnpm",
  "priority": ["pnpm", "bun", "yarn", "npm"],
  "interactive": true,
  "autoInstall": false
}

Project Configuration

Add a pmswitchConfig section to your package.json:

{
  "name": "your-project",
  "version": "1.0.0",
  "pmswitchConfig": {
    "defaultPackageManager": "yarn",
    "priority": ["yarn", "pnpm", "npm"],
    "interactive": true
  }
}

How It Works

  1. When you run a pms command, PMSwitch searches for lockfiles in the current directory
  2. It selects the appropriate package manager based on:
    • Detected lockfiles
    • Forced package manager flags
    • Configured priority order
    • User input (if interactive)
  3. It executes the equivalent command using the selected package manager

Supported Commands

PMSwitch supports all common package manager commands:

  • install
  • add
  • remove
  • run
  • exec
  • update
  • init
  • And more!

Troubleshooting

Multiple Lockfiles

If multiple lockfiles are detected in a project, PMSwitch will prompt you to choose which package manager to use. You can also force a specific package manager using the --force-* flags.

Missing Package Manager

If the detected package manager is not installed on your system, PMSwitch will notify you and provide instructions for installation.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT