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

@kirschbaum-development/dep-locker

v0.1.3

Published

Pin dependency versions to lock file resolutions for supply-chain security

Readme

dep-locker

Pin dependency versions to their lock file resolutions for supply-chain security.

Why This Exists

Software supply-chain attacks are no longer rare — they happen almost weekly. Attackers compromise maintainer accounts or take over abandoned packages, then push new versions containing malware. Because most projects use range constraints like ^1.2.0 or ~1.2.0, a simple npm install or composer update can silently pull in a compromised release.

The two most effective defenses are straightforward:

  1. Pin exact versions — so your project only installs the versions you've vetted, not whatever is newest
  2. Disable post-install scripts — since postinstall is the primary vector attackers use to execute malicious code

This tool automates both. It reads your lock file to find the versions you're actually running, pins your manifest to those exact versions, and configures .npmrc to enforce these practices going forward.

Usage

Run in your project root:

npx @kirschbaum-development/dep-locker

The tool will:

  1. Detect which package managers are in use (npm, yarn, bun, composer)
  2. Configure .npmrc with security best practices (save-exact=true, ignore-scripts=true)
  3. Pin all dependencies to the exact versions resolved in your lock file
  4. Re-run install to sync the lock file with the updated constraints

Supported Package Managers

| Manager | Manifest | Lock File | |----------|-------------------|----------------------| | npm | package.json | package-lock.json | | yarn | package.json | yarn.lock | | bun | package.json | bun.lock | | composer | composer.json | composer.lock |

What It Does

Given a package.json with:

{
  "dependencies": {
    "lodash": "^4.17.0",
    "express": "~4.18.0"
  }
}

And a lock file that resolved lodash to 4.17.21 and express to 4.18.3, the tool will update package.json to:

{
  "dependencies": {
    "lodash": "4.17.21",
    "express": "4.18.3"
  }
}

Features

  • Interactive prompts — confirm before making changes, choose which dependency types to pin
  • No downgrades — pins to the version currently in your lock file
  • .npmrc configuration — optionally adds save-exact=true and ignore-scripts=true
  • Skips non-pinnable deps — git refs, file links, workspace protocols, and branch aliases are left untouched
  • Preserves formatting — detects and maintains your manifest file's indentation style

Options

The tool runs interactively. You'll be prompted to:

  • Select .npmrc options (both checked by default):
    • save-exact=true — ensures future installs use exact versions
    • ignore-scripts=true — blocks post-install scripts (primary malware vector)
  • Choose dependency types to pin:
    • dependencies, devDependencies, optionalDependencies (checked by default)
    • peerDependencies (unchecked by default — typically left as ranges)
    • For composer: require and require-dev (both checked by default)

Requirements

  • Node.js >= 18

License

MIT