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

package-manager-alias-cli

v1.1.0

Published

One command to use any* package manager - a universal CLI that auto-detects and uses npm, yarn, pnpm, or bun

Downloads

126

Readme

package-manager-alias-cli

npm version License: MIT Node.js CI

One command to use any* package manager. A universal CLI that auto-detects and uses npm, yarn, pnpm, or bun.

Install

npm install -g package-manager-alias-cli

Or with other package managers:

yarn global add package-manager-alias-cli
pnpm add -g package-manager-alias-cli
bun add -g package-manager-alias-cli

Usage

Go to any Node.js project and use pm instead of your package manager:

# Instead of npm install / yarn install / pnpm install / bun install
pm install

# Instead of npm add lodash / yarn add lodash / pnpm add lodash / bun add lodash
pm add lodash

# Run scripts
pm run build
pm run test

# Any command works!
pm outdated
pm update
pm remove lodash

Options

-v, --version   Show version number
-h, --help      Show help message
--verbose       Show which package manager is being used

Examples

# Check the version
pm --version

# See help
pm --help

# See which package manager is detected
pm --verbose install
# Output: Detected package manager: yarn
#         yarn install v1.22.19
#         ...

How Detection Works

The tool detects your package manager in this priority order:

  1. Lockfile detection (highest priority):

    • yarn.lock → yarn
    • package-lock.json → npm
    • pnpm-lock.yaml → pnpm
    • bun.lockb → bun
  2. Fallback (if no lockfile found):

    • Checks if yarn, pnpm, or bun command exists
    • Falls back to npm if none are found
  3. Caching: Results are cached for performance

Troubleshooting

"Could not detect package manager"

This error occurs when you're not in a Node.js project directory. Make sure:

  • You have a package.json file in the current directory
  • Or you have a lockfile (package-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb)

Wrong package manager detected

The tool prioritizes lockfiles. If you want to switch package managers:

  1. Delete the old lockfile
  2. Run pm install to generate a new lockfile with your preferred package manager

Command not found: pm

Make sure the package is installed globally:

npm install -g package-manager-alias-cli

Then verify it's in your PATH:

which pm

Why Use This?

  • Consistency: Use one command across all projects
  • Simplicity: No need to remember which package manager each project uses
  • Speed: Automatically uses the fastest available package manager
  • Team-friendly: Works regardless of individual developer preferences

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Changelog

See CHANGELOG.md for a list of changes.

License

MIT - Leo Giovanetti