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

@ui-manifest-json/angular

v0.4.0

Published

Extract a diffable JSON manifest of routes, components and template trees from an Angular app's source.

Readme

@ui-manifest-json/angular

Extract a structured, diffable JSON manifest — routes, components, and optionally their full template element tree — from an Angular app's source.

npm install --save-dev @ui-manifest-json/angular
npx ui-manifest-angular --with-dom --out ui-manifest.json

Why source-derived: a live crawl or an accessibility snapshot only ever sees whichever branch of your UI happened to be rendered at capture time. Parsing the source captures every branch a template can produce — every @if/@for/@switch case, every *ngIf — including logic that never rendered during either capture.

Nothing leaves your environment. This reads your source and writes JSON.

How it works

A syntactic pass over each component source file (via the typescript package's AST) and over your Routes array. No type-checker Program, no tsc project load — so it never needs a tsconfig, installed node_modules, or a compiling project, and runs fine against partially-broken code. The trade is that anything not visible syntactically is left out rather than guessed at.

--with-dom additionally parses every template with @angular/compiler's real Ivy parseTemplate() — the same parser Angular's own compiler uses. It's an optional peer dependency, imported lazily only when you pass the flag.

Options

| Flag | Default | | |---|---|---| | --dir <path> | src/app | Directory to scan | | --routes <file> | app.routes.ts | Routes file, relative to --dir | | --with-dom | off | Also emit each component's template tree | | --dependency-graph | off | Per route, splice every descendant component's template in recursively (requires --with-dom) | | --base-href <path> | detected | Override the detected <base href> | | --router-mode <mode> | detected | path or hash | | --coverage <kind> | full | full or partial — whether a missing route means deleted | | --out <path> | stdout | Write to a file |

--base-href and --router-mode are detected from index.html, an APP_BASE_HREF provider, and withHashLocation() / useHash: true. Pass them when they're set at deploy time instead — an app served under /portal/ renders /portal/dashboard, and a consumer matching route paths against real URLs without knowing that matches nothing at all.

Tracking UI changes over time

npx ui-manifest-angular --with-dom --out ui-manifest.json
git diff --exit-code ui-manifest.json   # fails the build if the UI's structure changed

Output is deterministic, so a diff only shows real structural changes. Strip the two volatile blocks first — jq 'del(.generatedAt, .provenance)' — since those change on every run.

Angular compiler versions

Peer range is >=17.0.0, and --with-dom uses whichever @angular/compiler your project has. The AST has changed shape twice (SwitchBlock.cases → .groups in v22; TmplAstContent gained children after v17) and both are normalised. Older compilers legitimately can't parse newer template syntax — those components come back as a diagnostics entry rather than a crash.

typescript is capped at <6.0.0 deliberately: TypeScript 7 is the native compiler rewrite and its root export is no longer the classic AST API this package uses.

Documentation

License

MIT — see LICENSE.