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

@fkrzski/docs-schema

v0.6.0

Published

Shared frontmatter schema + validator for project docs (Astro content collection + CI validator)

Readme

@fkrzski/docs-schema

Shared frontmatter contract + validator for the open-source project docs published at docs.fkrzski.dev. One source of truth, consumed by the docs site, which builds its Astro content collection on it, and by a standalone CLI that project repos run against their own docs/ folder in CI.

What it checks

  • Frontmatter — every page matches the schema: required title + SEO-bounded description (50–160 chars), optional repository / packagist (vendor/package) / crates (a crates.io crate name) / status (stable | experimental | deprecated).

  • Markdown — .md files pass a shared markdownlint config (co-located in the validator).

  • Links — relative internal links resolve to a real file the docs site publishes.

  • Components — .mdx pages use only Aside, Badge, FileTree, Steps, Tabs and TabItem, which the docs site provides to every page, so a page imports nothing. Any other component tag is an error, and so is any import, @astrojs/starlight/components included.

  • Changelog — the CHANGELOG.md beside the docs folder, when there is one, passes the same markdownlint config and follows Keep a Changelog 1.1.0:

    • it opens with # Changelog, and any text may follow before the first release;
    • every ## is ## [Unreleased] or ## [X.Y.Z] - YYYY-MM-DD, optionally ending in [YANKED], with a SemVer 2.0.0 version and a real date;
    • [Unreleased] comes first and once, releases go newest first by SemVer precedence, each once, and dates never increase down the file;
    • every ### is Added, Changed, Deprecated, Removed, Fixed or Security, once per release, and no other heading levels appear;
    • every section lists at least one item and every release has a section, though an empty [Unreleased] is fine;
    • every bracketed version has a link definition such as [0.9.0]: https://….

    The docs site builds the project's changelog page from it, so a changelog.md or changelog.mdx page in the docs root is an error.

  • Sidebar and versions — the _meta.json in the docs folder, when there is one, matches Order pages and publish versions. The paths its ignore lists are no pages, so none of the checks above reads them.

Site-absolute and cross-project links are left to the docs site's link check at build time; the CLI only catches problems an author can fix inside their own docs/ folder.

Validate a docs folder in CI

Add one step to a project repo's workflow — no other dependency, and no reference to any private tooling repo:

- uses: actions/checkout@v4
- uses: actions/setup-node@v6
  with:
    node-version: 24
- name: Validate docs
  run: npx --yes @fkrzski/docs-schema docs

docs is the folder to validate (relative to the repo root). Exit codes: 0 pass, 1 validation problems, 2 usage error — so it gates the job like any other check.

The CHANGELOG.md next to that folder is validated with it, when there is one. If the workflow filters on paths, add CHANGELOG.md there so a changelog edit runs the check too.

Prefer a pinned dependency? Add @fkrzski/docs-schema to devDependencies and run docs-validate docs from a script instead of npx.

Order pages and publish versions

The sidebar lists the overview, then every other page by its path. A _meta.json in the docs folder sets another order, publishes older versions beside the latest one and keeps Markdown that is no page out of the docs site:

{
  "pages": ["guide", "configuration", "rate-limiting", "testing"],
  "versions": [{ "id": "v1", "label": "1.x", "ref": "1.4.0" }],
  "ignore": ["adr", "agents"]
}

Every key is optional, and no other key is allowed.

  • pages lists every page by its path without the extension (guide, guides/install), once each and in kebab-case. The overview (index) always comes first and the <name>-reference pages sit apart, so neither goes in the list.
  • versions pins each older version to a branch, tag or commit and publishes it at /<project>/<id>. The id is kebab-case without dots, unique, and neither latest, changelog nor the name of a page. label names it in the version switcher (id by default).
  • ignore lists paths relative to the docs folder: a folder covers everything below it, a file takes its extension, and there are no globs. Each entry is listed once, without a leading /, . or .., and must match a file or folder. The validator and the docs site skip those paths, so pages leaves them out and a relative link into them is an error.
  • Only the file on the default branch publishes versions. Each version's own _meta.json, if its ref has one, orders that version's pages and lists what it ignores; without one its pages go by path.

Trigger a docs deploy from a project repo

Docs go live from the central docs site, whose build pulls every project's docs/ afresh; a project repo signals "my docs changed" by POSTing to the site's Cloudflare Pages deploy hook. The hook URL is a secret, so nothing about the docs infrastructure appears in the public workflow:

- name: Trigger docs deploy
  env:
    DOCS_DEPLOY_HOOK: ${{ secrets.DOCS_DEPLOY_HOOK }}
  run: curl -fsS -X POST "$DOCS_DEPLOY_HOOK"

Run it after the validate step, on pushes to the default branch that touch docs/ or CHANGELOG.md, so every build has something new to ship. Each project gets a hook of its own, named after it, so a deployment shows which repo started it and a leaked hook is revoked alone.

Programmatic use

import { docsFrontmatterSchema, parseChangelog, packagistApiUrl } from '@fkrzski/docs-schema';
  • docsFrontmatterSchema — the Zod schema, a plain z.object, so .extend() adds site-only fields.
  • projectStatuses — the allowed status values.
  • contentComponents / ContentComponent — the components an .mdx page may use.
  • packagistPageUrl(pkg) / packagistApiUrl(pkg) — vendor/package → Packagist page / JSON API.
  • cratesPageUrl(name) / cratesApiUrl(name) — crate name → crates.io page / JSON API.
  • parseChangelog(markdown) — a Keep a Changelog file → { releases, issues }, with what parsed returned next to the issues; each release has its version, date, yanked, url, line and sections.
  • changelogSections / ChangelogSection — the six ### sections a release may have.

License

MIT © Filip Krzyżanowski