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

pkg-convert

v1.1.0

Published

Package Manager Converter - Convert commands between npm, yarn, pnpm, and bun

Readme

pmc - Package Manager Converter

Convert package manager commands between npm, yarn, pnpm, and bun.

Installation

bun install -g pkg-convert
npm install pkg-convert
pnpm add pkg-convert
yarn add pkg-convert

Usage

Convert a command

# Convert to bun
pmc bun "npm install lodash -D"

# Convert to pnpm
pmc pnpm "yarn add react react-dom"

# Convert to yarn
pmc yarn "pnpm add -g typescript"

# Convert to npm
pmc npm "bun add [email protected]"

Auto-detect source (no command = install)

pmc bun     # Output: bun install
pmc yarn    # Output: yarn install
pmc pnpm    # Output: pnpm install

Supported Commands

| Action | npm | yarn | pnpm | bun | |--------|-----|------|------|-----| | Install all | npm install | yarn install | pnpm install | bun install | | Add package | npm i pkg | yarn add pkg | pnpm add pkg | bun add pkg | | Add dev | npm i pkg -D | yarn add pkg -D | pnpm add pkg -D | bun add pkg -D | | Remove | npm uninstall pkg | yarn remove pkg | pnpm remove pkg | bun remove pkg | | Update | npm update | yarn upgrade | pnpm update | bun update | | Run script | npm run build | yarn run build | pnpm run build | bun run build | | Run binary | npx pkg | yarn dlx pkg | pnpm dlx pkg | bunx pkg | | Global add | npm i -g pkg | yarn global add pkg | pnpm add -g pkg | bun add -g pkg | | CI install | npm ci | yarn install --frozen-lockfile | pnpm install --frozen-lockfile | bun install --frozen-lockfile |

Flags

| Flag | npm | yarn | pnpm | bun | |------|-----|------|------|-----| | Dev dependency | -D | -D | -D | -D | | Optional | -O | --optional | -O | --optional | | Exact version | -E | --exact | -E | --exact | | Global | -g | global prefix | -g | -g | | Peer dependency | --save-peer | --peer | --save-peer | not supported |

API Usage

import { convert, parseCommand, convertCommand } from 'pmc';

// Convert a command string
const result = convert('npm install lodash -D', 'bun');
console.log(result.command); // "bun add lodash -D"

// Parse a command
const parsed = parseCommand('yarn add react react-dom -D');
console.log(parsed.packages); // ['react', 'react-dom']
console.log(parsed.isDev);    // true

// Convert parsed command
const result2 = convertCommand(parsed, 'pnpm');
console.log(result2.command); // "pnpm add react react-dom -D"

Lockfile Detection

The CLI auto-detects the current package manager by checking for lockfiles in this priority order:

  1. pnpm-lock.yaml → pnpm
  2. yarn.lock → yarn
  3. bun.lock / bun.lockb → bun
  4. package-lock.json → npm

Limitations

  • --save-peer is not supported in bun
  • audit and outdated commands fall back to npm equivalents for bun
  • Some Yarn Berry-specific commands may not convert correctly

License

MIT