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

freshgate

v0.1.0

Published

Block dependencies published too recently - a cooldown gate against hijacked npm releases.

Readme

freshgate

Block dependencies that were published too recently. A cooldown gate against hijacked npm releases.

npm node license

$ npx freshgate

freshgate · package-lock.json · cooldown 3 days · 412 packages checked

✖ 1 package published less than 3 days ago:

  @types/[email protected]  direct      published 1.2 days ago
                       → older version: @types/[email protected]

Why

Most npm supply-chain attacks (event-stream, ua-parser-js, the Shai-Hulud worm) follow the same pattern: an attacker publishes a malicious version, and it is detected and removed within hours or days. Projects that install it in that window get hit.

A cooldown closes that window: don't install any version until it has been public for a few days. pnpm has this built in (minimumReleaseAge). freshgate brings it to every project: npm, pnpm, yarn and bun, in CI or locally, with zero runtime dependencies.

Install

npx freshgate               # run once
npm i -D freshgate          # or add to your project

Requires Node.js 20+.

Usage

npx freshgate                     # check lockfile, 3-day cooldown
npx freshgate --days 7            # stricter cooldown
npx freshgate --allow "@myorg/*"  # trust your own packages
npx freshgate --direct-only       # only dependencies in package.json
npx freshgate --format github     # GitHub Actions annotations
npx freshgate --warn              # report only, never fail

Options

| Flag | Config key | Default | Description | |---|---|---|---| | --days <n> | minAgeDays | 3 | Minimum age a version must have | | --allow <pattern> | allow | [] | Exempt packages. Globs supported (@myorg/*). Repeatable or comma-separated | | --direct-only | directOnly | false | Check only dependencies listed in package.json | | --lockfile <path> | lockfile | auto-detect | Lockfile to check | | --registry <url> | registry | from .npmrc | Registry URL | | --format <type> | format | pretty | pretty, json or github | | --warn | warnOnly | false | Report violations but exit 0 | | --no-cache | — | cache on | Skip the on-disk publish-time cache | | --cwd <dir> | — | . | Project directory |

Config file

Put options in freshgate.config.json:

{
  "minAgeDays": 7,
  "allow": ["@myorg/*", "typescript"]
}

or in package.json:

{
  "freshgate": { "minAgeDays": 7 }
}

Command-line flags override the config.

Exit codes

| Code | Meaning | |---|---| | 0 | All packages pass (or --warn) | | 1 | At least one package is newer than the cooldown | | 2 | Error (no lockfile, bad option) |

CI

GitHub Actions

- uses: actions/checkout@v4
- uses: actions/setup-node@v4
  with:
    node-version: 22
- run: npx freshgate --format github

Violations show up as annotations on the pull request.

Before installing

{
  "scripts": {
    "preinstall": "npx freshgate"
  }
}

Note: preinstall checks the existing lockfile. To catch new versions introduced by an update, run freshgate after npm install and before you commit the lockfile, or in CI.

Supported lockfiles

| Package manager | File | Versions | |---|---|---| | npm | package-lock.json, npm-shrinkwrap.json | lockfile v1, v2, v3 | | pnpm | pnpm-lock.yaml | v5, v6, v9 | | yarn | yarn.lock | classic (v1) and berry (v2+) | | bun | bun.lock | text format |

Git, file, link and workspace dependencies are skipped. They have no registry publish date.

Private registries

freshgate reads ~/.npmrc and the project .npmrc, including scoped registries (@myorg:registry=...), _authToken entries and ${ENV_VAR} expansion. npm_config_registry is respected.

Programmatic API

import { checkFreshness, formatReport } from "freshgate";

const report = await checkFreshness({
  cwd: process.cwd(),
  minAgeDays: 7,
  allow: ["@myorg/*"],
});

for (const v of report.violations) {
  console.log(`${v.name}@${v.version} is ${v.ageDays.toFixed(1)} days old. Try ${v.suggestion}`);
}

console.log(formatReport(report, "pretty"));

checkFreshness(options): Promise<Report>

| Option | Type | Default | |---|---|---| | cwd | string | process.cwd() | | minAgeDays | number | 3 | | allow | string[] | [] | | directOnly | boolean | false | | lockfile | string | auto-detect | | registry | string | from .npmrc | | cache | boolean | true | | cacheFile | string | ~/.cache/freshgate/publish-times.json | | concurrency | number | 8 |

Report contains checked, allowed, violations (name, version, direct, publishedAt, ageDays, suggestion) and skipped (packages that could not be verified, with a reason).

How it works

  1. Reads every package and version from your lockfile.
  2. Fetches each package's publish times from the registry (one request per package, 8 in parallel).
  3. Flags versions published within the cooldown window and suggests the newest version in the same major that passes.
  4. Caches publish times on disk. They never change, so repeat runs are fast.

Packages that can't be verified (not found, network error) are listed separately. They are never silently counted as passing.

License

MIT