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

site-linkcheck

v0.1.0

Published

Configurable Playwright link checker with optional notifications.

Downloads

130

Readme

Site Linkcheck

Site Linkcheck is a configurable Playwright link checker. It crawls internal pages, validates internal and external links, and writes JSON/CSV reports.

Install

nvm use
npm install
npx playwright install chromium

Quick Start

npm run config:validate
npm run check

Run any website directly:

npx tsx src/run.ts crawl https://example.com --max-depth 1 --max-links 100 --reports-dir reports

Run from configuration:

npx tsx src/run.ts crawl --config linkcheck.config.json --target example

CLI

linkcheck crawl <url>
linkcheck crawl --config linkcheck.config.json --target example
linkcheck config validate --config linkcheck.config.json
linkcheck reports merge reports
linkcheck notify --provider slack --report reports/_merged-file.json
linkcheck notify --provider telegram --report reports/_merged-file.json

Useful crawl options:

  • --entrypoint <path> repeatable entrypoint override.
  • --max-depth <number> crawl depth.
  • --max-requests <number> max pages per crawl.
  • --max-links <number> max checked links per crawl (0 in config means unlimited).
  • --concurrency <number> parallel browser work.
  • --timeout <ms> navigation timeout.
  • --exclude <pattern> paths to check but not crawl recursively.
  • --ignore-extension <ext> URL extensions to skip.
  • --storage-state <path> Playwright storageState file.
  • --header <name:value> custom HTTP header.
  • --skip-from-reports incremental mode.
  • --fail-on-broken exit with code 2 when broken links are found.
  • --json machine-readable command output.

Configuration

The default config lives in linkcheck.config.json and is described by schemas/linkcheck.schema.json.

{
  "$schema": "./schemas/linkcheck.schema.json",
  "targets": {
    "example": {
      "baseUrl": "https://example.com",
      "entrypoints": ["/"],
      "crawl": {
        "maxDepth": 1,
        "maxRequestsPerCrawl": 50,
        "maxLinksToCheckPerCrawl": 0,
        "concurrency": 2
      }
    }
  },
  "reports": {
    "directory": "./reports",
    "formats": ["json", "csv"]
  },
  "notifications": []
}

Authentication is optional. For authenticated checks, generate a Playwright storage state yourself and reference it:

{
  "targets": {
    "private-docs": {
      "baseUrl": "https://docs.example.com",
      "auth": {
        "storageState": "./secrets/docs.storage.json",
        "headers": {
          "x-linkcheck-run": "ci"
        }
      }
    }
  }
}

Do not store secrets in config. Use environment variables or CI secrets.

Notifications

Slack is optional:

export SLACK_WEBHOOK_URL="https://hooks.slack.com/services/..."
npx tsx src/run.ts notify --provider slack --report reports/_merged-file.json

Telegram is optional:

export TELEGRAM_BOT_TOKEN="..."
export TELEGRAM_CHAT_ID="..."
npx tsx src/run.ts notify --provider telegram --report reports/_merged-file.json

CI

This repository includes both .github/workflows/ci.yml and .gitlab-ci.yml. Both run the same project commands:

npm ci
npx playwright install chromium
npm run typecheck
npm test
npm run test:coverage
npm run config:validate

Scheduled crawl jobs should call npm run check or a target-specific linkcheck crawl --config ... --target ... command.

Exit Codes

  • 0: command completed.
  • 1: runtime error.
  • 2: broken links were found with --fail-on-broken.
  • 3: invalid arguments or configuration.
  • 4: required notification failed.

Development

nvm use
npm run typecheck
npm test
npm run test:coverage