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

web-vitals-checker

v1.0.0

Published

CLI to audit Core Web Vitals for any URL or sitemap, with history tracking and a local Vanilla Framework dashboard

Readme

web-vitals-cli

A zero-dependency Node.js CLI that checks Core Web Vitals for any URL or sitemap using the Google PageSpeed Insights API. Results are persisted locally so you can track scores over time and view trends in a local web dashboard.

Requirements

  • Node.js 18 or later (uses the built-in fetch API)
  • A Google API key is recommended (free, 25,000 requests/day). Without one the shared quota can be exhausted.

Setup

# Get a free API key
# https://developers.google.com/speed/docs/insights/v5/get-started

# Export it so every run picks it up automatically
export PSI_API_KEY=your-key-here

# Or pass it per-run
node index.js https://example.com --key your-key-here

No npm install is needed — the project has zero runtime dependencies.


Usage

Analyse a single page

node index.js https://example.com

Prints lab data (Lighthouse) and field data (CrUX real-user metrics) for the URL, followed by a score history trend if the URL has been checked before.

Analyse all pages in a sitemap

URLs ending in .xml or containing sitemap in the path are auto-detected as sitemaps. Sitemap index files (nested sitemaps) are resolved recursively.

node index.js https://example.com/sitemap.xml

Outputs a sorted table of every checked page with Score, Δ (change since last run), LCP, CLS, TBT, run count, and URL — plus Top Performers and Needs Attention sections.

View history in the terminal

node index.js history            # all strategies
node index.js history --mobile   # mobile only
node index.js history --desktop  # desktop only

Shows a compact table of every tracked URL with its latest score, delta from the previous run, a sparkline of the last 10 runs, and run count.

Open the web dashboard

node index.js serve              # http://localhost:3000
node index.js serve --port 8080

A Vanilla Framework dashboard that reads the history file on every request and auto-refreshes every 60 seconds. Run scans in a separate terminal and refresh the browser to see results update live.


Options

| Flag | Default | Description | |---|---|---| | --desktop | ✓ default | Simulate a desktop browser | | --mobile | | Simulate a mobile browser | | --key <api-key> | $PSI_API_KEY | Google PageSpeed Insights API key | | --limit <n> | 50 | Max pages to check from a sitemap | | --top <n> | 10 | Pages highlighted in Top Performers | | --concurrency <n> | 3 | Parallel PSI requests | | --history <path> | ~/.web-vitals-history.json | History file location | | --no-save | | Skip writing results to history | | --port <n> | 3000 | Dashboard port (serve only) | | --help, -h | | Show help |


Scoring thresholds

| Score | Rating | |---|---| | 90 – 100 | Good (green) | | 50 – 89 | Needs Improvement (yellow) | | 0 – 49 | Poor (red) |

These match the Lighthouse scoring scale.


History file

Results are appended to ~/.web-vitals-history.json after every run. The file is keyed by strategy:url so mobile and desktop scores are tracked independently. Up to 50 entries are kept per URL per strategy.

{
  "desktop:https://example.com/": [
    {
      "ts": "2026-05-13T10:00:00.000Z",
      "score": 92,
      "lcp": 1300,
      "cls": 0.01,
      "tbt": 140,
      "fcp": 850
    }
  ]
}

Use --history <path> to store separate histories for different projects, or --no-save to run a one-off check without touching the file.


Metrics reference

| Metric | Full name | Weight | |---|---|---| | LCP | Largest Contentful Paint | High | | CLS | Cumulative Layout Shift | High | | TBT | Total Blocking Time (lab proxy for INP/FID) | High | | FCP | First Contentful Paint | Medium | | SI | Speed Index | Medium | | TTI | Time to Interactive | Medium | | INP | Interaction to Next Paint (field data only) | High |