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

deadlink-checker-cli

v1.0.1

Published

Find broken links in websites and markdown files

Readme

deadlink-checker-cli

Find broken links in websites and markdown files — zero dependencies, CI-friendly.

npm version License: MIT

Features

  • Crawl websites and check every link on the page
  • Check all links in a markdown file ([text](url), <url>)
  • Recursively check all .md files in a directory
  • Colored output: red for BROKEN, green for OK
  • Follows redirects (up to 3 hops)
  • HEAD-first requests with GET fallback
  • Concurrent link checking (configurable, default 5)
  • URL caching — never checks the same URL twice
  • Skips mailto:, tel:, #anchor links automatically
  • Exit code 1 when broken links found (CI-friendly)
  • Zero external dependencies — uses Node.js built-ins only

Install

npm install -g deadlink-checker-cli
# or use without installing:
npx deadlink-checker-cli <target>

Usage

# Check all links on a website
deadlink https://example.com

# Crawl 2 levels deep
deadlink https://example.com --depth 2

# Check links in a markdown file
deadlink README.md

# Custom timeout (ms)
deadlink README.md --timeout 5000

# Check all .md files in a directory
deadlink --dir ./docs

# Show OK links too
deadlink README.md --verbose

# Adjust concurrency
deadlink https://example.com --concurrency 10

Output

deadlink-checker-cli v1.0.0

Checking file: /path/to/README.md
  BROKEN https://old.example.com/gone (HTTP 404)
  ERROR  https://dead.example.com (Timeout)
  BROKEN https://moved.example.com/page (HTTP 410)

──────────────────────────────────────────────────
Summary:
  OK:      12
  Broken:  3
  Skipped: 2 (mailto:, tel:, #anchors, etc.)
  Total checked: 15
──────────────────────────────────────────────────

FAILED — 3 broken link(s) found.

Options

| Flag | Short | Default | Description | |------|-------|---------|-------------| | --depth | -d | 1 | Crawl depth for website URLs | | --timeout | -t | 10000 | Request timeout in milliseconds | | --concurrency | -c | 5 | Max concurrent requests | | --verbose | -v | off | Show OK links in output | | --help | -h | — | Show help |

Exit Codes

| Code | Meaning | |------|---------| | 0 | All links OK | | 1 | One or more broken links found | | 2 | CLI usage error (file not found, etc.) |

GitHub Actions

name: Check Broken Links

on:
  push:
    branches: [main]
  pull_request:
  schedule:
    - cron: '0 8 * * 1'  # Every Monday

jobs:
  deadlinks:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Check broken links in docs
        run: npx deadlink-checker-cli --dir ./docs

      - name: Check README
        run: npx deadlink-checker-cli README.md

Use Cases

  • Pre-commit hook to catch broken links before merging
  • Weekly scheduled CI to detect link rot
  • Validate documentation before publishing
  • SEO audits — detect dead outbound links

License

MIT © Wilson Xu