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

@route-intelligence/core

v2.2.0

Published

Core routing intelligence engine for React applications

Readme

@route-intelligence/core

Graph engine, analysis pipeline, algorithms, and exporters. Framework-agnostic: it never depends on React or Next.js.

You usually get this package transitively via @route-intelligence/cli. Install it directly only when you want to run analysis from your own Node code.

Install

npm install @route-intelligence/core

You also need at least one framework plugin (for example @route-intelligence/next) and pass it in plugins.

Analyze from code

import { createAnalyzer, exportJson, exportMermaid } from '@route-intelligence/core';
import { NextPlugin } from '@route-intelligence/next';

const analyzer = createAnalyzer({
  root: process.cwd(),
  plugins: [NextPlugin()],
  include: ['app/**', 'pages/**', 'src/**', 'middleware.ts'],
  exclude: ['**/node_modules/**', '**/.next/**'],
});

const result = await analyzer.analyze();

console.log(result.metadata.totalRoutes);
console.log(result.diagnostics);

const json = exportJson(result.graph, process.cwd());
const mermaid = exportMermaid(result.graph);

Pipeline

createAnalyzer runs a staged pipeline:

  1. File system scan
  2. Route discovery (plugins)
  3. Parse / AST
  4. Semantic analysis
  5. Navigation analysis
  6. Static analysis (dead routes, cycles, broken links)
  7. Graph build + metrics

Plugins register through PluginRegistry. Active plugins are those whose detect() returns true for the project.

Watch

const watcher = analyzer.watch();

watcher.on('update', (patch) => {
  console.log(patch.addedNodes.length, patch.removedNodeIds.length);
});

watcher.on('error', (err) => console.error(err));

await watcher.stop();

Uses chokidar plus an incremental cache (default directory .route-intelligence).

Graph API

RouteGraph stores nodes (routes, layouts, middleware, API routes, …) and typed edges (navigation, redirect, layout-parent, prefetch, …).

Algorithms:

  • findCycles
  • findDeadRoutes
  • findShortestPath
  • detectInfiniteRedirects
  • getMostConnected
  • computeMetrics / metricsToMetadata

Exporters

| Function | Output | |----------|--------| | exportJson | Serialized graph JSON | | exportMermaid | Mermaid flowchart (ELK, left-to-right) | | exportPlantUML | PlantUML | | exportDot | Graphviz DOT | | exportHtml | Standalone HTML report | | exportMarkdown | Markdown route list |

Config helper

import { defineConfig } from '@route-intelligence/core';

export default defineConfig({
  root: '.',
  plugins: [],
});

Types for AnalyzerConfig, AnalysisResult, Diagnostic, and FrameworkPlugin are re-exported from @route-intelligence/shared.

License

MIT