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

pnpm-lock-buddy

v0.3.0

Published

CLI tool for analyzing pnpm-lock.yaml files

Downloads

925

Readme

pnpm-lock-buddy

A tool for detecting duplicate package installations in pnpm monorepos. Finds packages resolved with different versions or different peer dependencies that cause runtime conflicts and bundle bloat.

Installation

pnpm install -g pnpm-lock-buddy

Quick Start

# Find all duplicate packages
pnpm-lock-buddy duplicates

# Check specific packages (supports wildcards)
pnpm-lock-buddy duplicates react "react*" "@types/*"

# Show which projects have duplicates
pnpm-lock-buddy duplicates --per-project

# Show dependency paths (how duplicates are included)
pnpm-lock-buddy duplicates --per-project --deps

# Ignore dev dependencies
pnpm-lock-buddy duplicates --omit dev

# CI/CD: exit code 1 if duplicates found
pnpm-lock-buddy duplicates --exit-code

Use Case: Detect Same Package with Different Peer Dependencies

A common issue in monorepos is the same package being resolved with different peer dependency versions. This creates multiple instances at runtime, breaking shared state like React Context.

pnpm-lock-buddy duplicates --per-project --deps next-navigation-guard
next-navigation-guard:
  apps/my-webapp: has 2 instances
    └─(link:)─ @acme/webapp-boosters@link:../../packages/webapp/webapp-boosters
       └─── [email protected]([email protected](@babel/[email protected])...) [1]
    └─── [email protected]([email protected](@babel/[email protected])...) [2]

Both instances are 0.1.2, but resolved with different @babel/core versions (7.27.7 vs 7.28.6), causing next to be instantiated twice and breaking NavigationGuardProvider.

GitHub Action

Use ypresto/pnpm-lock-buddy/duplicates@v1 to check for duplicates in CI:

- uses: ypresto/pnpm-lock-buddy/duplicates@v1
  with:
    packages: |
      next
      react
      react-dom
      @types/react

The step fails if duplicates are found. Set comment: 'true' to post results as a collapsible PR comment.

Action Inputs

| Input | Default | Description | |-------|---------|-------------| | packages | (required) | Space-separated package names (supports wildcards) | | per-project | true | Group duplicates by project | | deps | false | Show dependency tree paths | | omit | | Dependency types to omit (e.g., dev optional) | | lockfile | | Path to pnpm-lock.yaml | | ignore-file | .pnpm-lock-buddy-ignore | Path to ignore file | | comment | false | Post results as a collapsible PR comment (needs pull-requests: write) | | max-old-space-size | 8192 | Node.js heap size in MB | | version | (bundled) | pnpm-lock-buddy version | | extra-args | | Additional CLI arguments |

Ignore File

Create .pnpm-lock-buddy-ignore to suppress known-acceptable duplicates:

# Ignore all duplicates in a project
apps/storybook

# Ignore specific package in a project
apps/web:@types/react

Options

-f, --file <path>       Path to pnpm-lock.yaml file
-a, --all               Show all packages, not just duplicates
-p, --per-project       Group duplicates by project
--project <projects>    Filter by project paths (comma-separated)
--deps                  Show dependency tree paths
--deps-depth <number>   Limit tree display depth
--depth <number>        Dependency tree build depth (default: 10)
--omit <types...>       Omit: dev, optional, peer
--ignore-dev            Shorthand for --omit dev
--ignore-file <path>    Path to ignore file for suppressing results
--print-store-path      Show pnpm store paths instead of lockfile keys
--exit-code             Exit 1 if duplicates found (for CI/CD)
-o, --output <format>   Output format: tree, json

Output Format

Global mode (default):

react has 2 instances:
  [email protected] [1] (dependencies)
    Used by: apps/web, packages/ui
  [email protected] [2] (dependencies)
    Used by: apps/experimental

Per-project mode (--per-project):

react:
  apps/web: has 2 instances
    ├─── [email protected] [1]
    └─── [email protected] [2]
  • [1], [2]: Instance numbers (per package, consistent across projects)
  • (dependencies): Dependency type

License

MIT