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 🙏

© 2025 – Pkg Stats / Ryan Hefner

pkg-guardian

v0.1.0

Published

A security CLI tool to scan and protect your Node.js projects from compromised npm packages and supply chain attacks.

Readme

pkg-guardian

Scan Node.js projects for compromised npm packages from the command line. Protect your supply chain with real-time security scanning.

Install (global CLI)

npm install -g pkg-guardian

After installing globally you can run the command from any directory:

pkg-guardian

You can also use the alias scan-compromised for backward compatibility.

This scans the current working directory.

Usage

pkg-guardian [options]

Common examples:

pkg-guardian                         # Scan current directory (uses bundled compromised.txt)
pkg-guardian --path ./some-repo      # Scan a specific repo
pkg-guardian --repos repos.txt       # Scan many repos listed in a file
pkg-guardian --verbose               # Verbose output
pkg-guardian --compromised-url https://your-api/compromised  # Fetch from API (cached for 1 day)

Options

  • --path <dir> – scan a single repo directory.
  • --repos <file> – scan multiple repos listed in a text file (one path per line).
  • --compromised <file> – use a custom compromised list file instead of the bundled one.
  • --compromised-url <url> – fetch the compromised list from a remote API endpoint (expects JSON array of package names). The list is cached in compromised.txt with a timestamp and only re-fetched if older than 1 day. Falls back to the bundled file if the fetch fails.
  • --output <file> – output report path (default: scan-report.csv).
  • --format <csv|json> – output format (default: csv).
  • --verbose – extra logging.
  • --deep – deep scanning mode for package-lock.json.
  • --fail-on-find – exit with code 1 if compromised packages are found (default: true).

Future Roadmap

Managed API Service

As more compromised libraries are discovered, we will provide a managed API service with personalized authentication tokens. This will include:

  • Personalized API tokens – Generate your own token for authenticated access to the latest compromised package list.
  • Usage tracking – Monitor your API usage and scan history.
  • Automatic updates – Keep your local cache up-to-date with the latest security intelligence.
  • User-friendly dashboard – Token generation and management interface.

Pre-Install Guard

A key goal of this package is to act as a security guard that runs before any dependency installation. This will help prevent compromised packages from entering your project in the first place.

Planned features:

  • Pre-install hooks – Automatically check packages before npm install, yarn add, or pnpm install.
  • Real-time protection – Block installation of known compromised packages immediately.
  • CI/CD integration – Fail builds automatically if compromised dependencies are detected.
  • Proactive security – Catch supply chain attacks before they affect your codebase.

This will transform the tool from a scanner into a proactive defense system against npm supply chain attacks.