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/react

v0.4.0

Published

Extract a diffable JSON manifest of routes, components and JSX trees from a React app's source.

Readme

@ui-manifest-json/react

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

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

Why source-derived: a live crawl only ever sees whichever branch of your UI happened to be rendered at capture time. Parsing the source captures every branch — every ternary, &&, and .map() — 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 your .ts/.tsx/.jsx/.js files via the typescript package's AST. No type-checker Program, no tsc project load — so it needs no tsconfig, no installed node_modules, and no compiling project. A Babel-compiled app whose components all live in plain .js files is read the same as a TypeScript one.

Routes come from either React Router pattern, detected per file:

  • createBrowserRouter / createHashRouter / createMemoryRouter with a route-object array
  • a JSX route table: <Routes>…<Route/>…</Routes> on v6/v7, <Switch>…<Route/>…</Switch> (or bare <Route>s) on v3/v4/v5 — with element={<X/>}, component={X}, render={() => <X/>} and <Route path="/x"><X/></Route> all read as the route's target

Both react-router-dom and the base react-router package are recognised — v6.4+ apps increasingly import from the latter directly.

Read this before trusting a heuristic node

Every node carries extraction: "compiler" | "heuristic". JSX conditional rendering is arbitrary JavaScript, not a template grammar built for the purpose, so control-flow detection is pattern-matching and is marked honestly as such — the underlying code can always route around a pattern in a way that isn't detected. Angular's equivalent is a real parser and is marked compiler.

docs/react-extraction-limits.md is the full account of what can and can't be detected.

Known gap: Next.js file-based routing (app//pages/) is not implemented. It's a documented stub, not a silent miss.

Options

| Flag | Default | | |---|---|---| | --dir <path> | src | Directory to scan | | --routes-glob <glob> | all files | Narrow which files are checked for router setups | | --with-dom | off | Also emit each component's JSX tree | | --dependency-graph | off | Splice descendant components in recursively (implies --with-dom) | | --warn-unnamed | off | Diagnostic per skipped anonymous default export | | --base-href <path> | detected | Override the detected router basename | | --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 basename on your router and from HashRouter/createHashRouter. Only string literals count — basename={BASE} needs a type checker, which this package deliberately doesn't load, so it defaults and says so via app.confidence.

Tracking UI changes over time

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

Strip the volatile blocks before diffing: jq 'del(.generatedAt, .provenance)'.

Documentation

License

MIT — see LICENSE.