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

@ngrdt/docs

v0.3.1

Published

Documentation framework for the ngrdt libraries — the in-house replacement for ng-doc. Pages are plain markdown, everything component-related (inputs, outputs, methods, CSS tokens, playgrounds, API tables) is **generated from the TypeScript source** by a

Downloads

578

Readme

@ngrdt/docs

Documentation framework for the ngrdt libraries — the in-house replacement for ng-doc. Pages are plain markdown, everything component-related (inputs, outputs, methods, CSS tokens, playgrounds, API tables) is generated from the TypeScript source by a prebuild analyzer. The app builds with the standard @angular/build:application executor; there is no custom builder.

The live documentation is apps/rdt-docs-next (npx nx serve rdt-docs-next). A full authoring guide with rendered examples lives inside the docs themselves under Getting started → Writing docs.

How it works

docs/**/*.md ──► prebuild (tsx, ~1.5 s) ──► generated manifest + content assets + component meta
                     │                                        │
                     │  TS analyzer (tsconfig program)        ▼
                     └─ inputs/outputs/methods/CSS tokens ──► playgrounds, API tables

The prebuild is a plain Node script wired as a cached Nx target (rdt-docs-next:prebuild, build depends on it). Watch mode re-runs on markdown changes and reuses the TS analysis unless a .ts file changed.

Authoring a page

Pages follow a folder convention under the app's docs/ root — no per-page TypeScript:

docs/components/category.json          { "title": "Components", "order": 3, "expandable": true }
docs/components/tooltip/index.md       the page (frontmatter + markdown)
docs/components/tooltip/demo/…         demo components (plain Angular components)

Frontmatter keys: title, order, keywords (search boost), and for tab variants a sibling folder with its own .md using route/title (see existing rdt-gov-* pages).

A complete component page can be one directive:

---
title: Tooltip
order: 12
---

:::component RdtGovTooltipComponent playground

Directives

| Directive | Effect | |---|---| | :::component <Class> [playground] | Expands to description + optional Playground + API sections | | :::description <Class> | Lead paragraph from the class JSDoc | | :::playground <Class> | Live component + auto-discovered controls, code snippet, theming editor, shareable URL state | | :::api <Class> | Input/Output/Method/CSS-token tables (JSDoc descriptions, @deprecated badges) | | :::demo <Class> [files="a.ts,a.html"] | Live demo with extracted source tabs | | :::code <path>[#region] | Embeds a real source file (or // #region section) as a code block | | :::include <path> | Inlines another markdown file at prebuild |

Directives inside fenced code blocks stay literal — safe to show as examples.

Code fences support a file-name label: ```ts fileName="my-page.component.ts".

What the analyzer extracts

For every class referenced by :::api/:::playground (any class exported from a workspace library barrel works — the analyzer adds all tsconfig-path roots):

  • inputsinput(), input.required(), model() incl. inherited ones, aliases, transforms, literal-union select options, statically resolvable defaults, JSDoc descriptions
  • outputsoutput(), outputFromObservable(), plus implicit <model>Change
  • methods — public, JSDoc-documented (lifecycle and private members are skipped)
  • CSS tokens--rdt-* custom properties from the component scss (styleUrl + sibling files)
  • selector and class description (JSDoc); @deprecated tags become badges

Writing JSDoc on the component/inputs is all it takes to fill descriptions everywhere (API tables, description paragraphs).

Playground registry (app side)

export const DOCS_PLAYGROUNDS: RdtDocsPlaygroundRegistry = {
  RdtGovButtonComponent: {
    loadComponent: () => Promise.resolve(RdtGovButtonComponent),
    controlOverrides: { label: { defaultValue: 'Gov Button' } },
  },
  MyWrapperComponent: {
    loadComponent: () => import('./wrapper').then((m) => m.MyWrapperComponent),
    hideSnippet: true,                       // wrapper selector would mislead consumers
    themingTokensFrom: 'RdtTableComponent',  // whose CSS tokens power the theming editor
    staticInputs: { config: { /* fixed, hidden from the panel */ } },
    hideInherited: true,
  },
};

App setup

provideRdtDocs({
  manifest: RDT_DOCS_MANIFEST,               // generated
  componentMeta: RDT_DOCS_COMPONENT_META,    // generated
  demos: DOCS_DEMOS,
  playgrounds: DOCS_PLAYGROUNDS,
  editUrl: (sourcePath) => `…repo url…?path=/docs/${sourcePath}`,  // "Edit this page"
}),
provideRouter([...ownRoutes, ...buildRdtDocsRoutes(RDT_DOCS_MANIFEST)], withInMemoryScrolling(...)),

Prebuild CLI (see apps/rdt-docs-next/project.json for the wired target):

tsx @ngrdt/docs/prebuild/main.ts
  --root <docs-dir> --out <content-dir> --manifest <manifest.ts>
  --tsconfig <app tsconfig> --component-meta <meta.ts>
  [--strict-links]   fail the build on broken internal links (watch mode only warns)
  [--watch]

Build assets must serve the generated content (docs-content/) and llms.txt; the shell, search (⌘K), theme toggle, TOC rail, mobile drawer and landing patterns are shown in apps/rdt-docs-next.

Peer dependencies

marked, shiki (+ @shikijs/langs, @shikijs/themes), minisearch, @ngrdt/tabs; the prebuild additionally uses typescript and chokidar (dev).