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

@kkirbatski/pnpm-locksmith

v1.0.5

Published

Sync package.json dependency versions to the exact versions in your pnpm lockfile (and optional resolutions via pnpm why)

Readme

pnpm-locksmith

License: Unlicense

Synchronize your package.json to match the exact versions in your pnpm lockfile.

This CLI updates:

  • dependencies and devDependencies: pins each entry to the version currently installed (from pnpm ls --json)
  • resolutions and pnpm.overrides: sets each entry to the version reported by pnpm why PACKAGE_NAME

It writes changes back to package.json.

Why

Keeping package.json versions aligned with the lockfile helps you:

  • Make diffs clearer (no “^/~” ranges when you really want the locked version)
  • Improve reproducibility (what’s installed is exactly what’s declared)
  • Reduce accidental upgrades when teammates or CI install

Requirements

  • Node.js 18+ (recommended)
  • pnpm installed and on your PATH
  • An existing pnpm-lock.yaml (i.e., you’ve already run pnpm install)

Usage

Run the tool in the root of the package/workspace you want to update.

  • One-off (no install):
pnpm dlx @kkirbatski/pnpm-locksmith
  • As a dev dependency:
pnpm add -D @kkirbatski/pnpm-locksmith
pnpm exec pnpm-locksmith

What to expect:

  • The command updates package.json in place.
  • If a dependency in package.json cannot be found in the current pnpm dependency graph, the tool will error (ensure you’ve installed first).

Tip: run under version control so you can quickly review or revert changes.

git diff package.json
# If needed
git checkout -- package.json

How it works

  • Reads the current package.json
  • Reads your dependency graph via pnpm ls --json
  • For each key in dependencies and devDependencies, finds the installed version, and writes that exact version back to package.json
  • If a resolutions or pnpm.overrides field exists, runs pnpm why PACKAGE_NAME --json and uses the reported version
  • Writes the updated package.json to disk

Notes and limitations

  • The tool expects dependencies in package.json to already be installed. Run pnpm install first.
  • Monorepos: Should work.
  • This tool does not add or remove dependencies; it only updates existing version strings.

Development

  • Build:
pnpm install
pnpm build
  • Run from source:
node build/pnpm-locksmith.js

License

This project is dedicated to the public domain under The Unlicense. See the LICENSE file for details.