orphan-beacon

Beacon · SEO & discoverability

orphan-beacon

Find the pages in your built static site that nothing links to, and measure how many clicks every page is from the homepage.

npm i -D @mrlouiswright/orphan-beacon

Published to GitHub Packages: add @mrlouiswright:registry=https://npm.pkg.github.com to .npmrc first (installing needs a token with read:packages).

What it checks

  • Orphansindexable pages with no internal inbound links (noindex pages and pages canonicalised elsewhere are skipped).
  • Reachabilitypages that are linked, but only from a cluster that the homepage cannot reach; pages linked only with rel=nofollow/ugc/sponsored; pages linked only from noindex pages; pages only reachable via javascript:/onclick navigation.
  • Click depthbreadth-first shortest path from the homepage (or --start) following crawlable links; pages deeper than --max-depth (default 3).
  • Link equity hintspages with a single inbound link (info) and dead-end pages with no outgoing internal links.

Quick usage

CLI

npx orphan-beacon dist
npx orphan-beacon dist --max-depth 4 --fail-on medium
npx orphan-beacon public --ignore "/landing/**,/campaign-*"
npx orphan-beacon out --clean-urls --format json > link-graph.json

API

import { check } from "orphan-beacon";
const report = check("dist", { maxDepth: 4 });
console.log(report.info); // { pages, orphans, maxDepth, start }

Every option is documented in the orphan-beacon docs.

CI / GitHub Action

permissions:
  contents: read
  security-events: write   # only needed for the SARIF upload
jobs:
  orphan-beacon:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
        with: { persist-credentials: false }
      - run: npm ci && npm run build   # produce the static site first
      - uses: MrLouisWright/orphan-beacon@v1
        with:
          path: dist
          fail-on: high
          sarif: orphan-beacon.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with: { sarif_file: orphan-beacon.sarif }