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

nextmap

v1.0.1

Published

A visual, interactive map of all your Next.js routes. Zero config.

Readme


Stop guessing where your routes live. nextmap scans your Next.js project and renders a zoomable, interactive map of every page, API route, layout, and middleware — right in your browser.

Supports App Router, Pages Router, and hybrid projects. No compilation, no config, no dependencies on your project.

Quick Start

npx nextmap

That's it. Opens your browser with a visual map of all your routes.

Or install globally:

npm i -g nextmap
cd your-nextjs-project
nextmap

Features

  • Instant route discovery — Scans app/ and pages/ directories, no config needed
  • Interactive graph — Zoomable, pannable route map powered by React Flow with minimap
  • Hierarchical tree layout — Routes grouped by path segments, with sub-groups for deep APIs. Children laid out left-to-right for clear visual hierarchy
  • App Router support — Pages, API routes, layouts, route groups (auth), parallel routes @modal, intercepting routes (.), dynamic segments [id], catch-all [...slug], optional catch-all [[...slug]]
  • Pages Router support — Pages, API routes, dynamic routes
  • Hybrid projects — Detects and displays both routers, filterable
  • HTTP method detection — Reads route.ts exports to show GET, POST, PUT, PATCH, DELETE with color-coded badges
  • Middleware visualisation — Shows middleware matchers, splits routes into protected/unprotected sections with connecting edges
  • Special file indicatorsloading.tsx, error.tsx, not-found.tsx, template.tsx shown as badges on route cards
  • Source code viewer — Click any route to see its source with syntax highlighting in the detail panel
  • Route detail panel — Resizable sidebar showing path, type, methods, file path, dynamic segments, route group, parallel slot info
  • Filter & search — Filter by type (pages, APIs, middleware), by router (app, pages), or search by path
  • Layout direction toggle — Switch between left-to-right and top-to-bottom
  • SVG export — Download a static SVG from the UI or export via CLI
  • Dark & light mode — Respects system preference with manual toggle
  • Zero config — No setup, no schemas, no annotations. Just run it

Screenshots

Usage

# Via npx
npx nextmap

# Interactive mode (opens browser)
nextmap

# Custom port
nextmap --port 4000

# Don't open browser
nextmap --no-browser

# Export as SVG (no server)
nextmap --export-svg
nextmap --export-svg -o my-routes.svg

What gets scanned

| Feature | App Router | Pages Router | | ------------------- | ------------------------------------------- | ------------------- | | Pages | page.tsx | *.tsx in pages/ | | API routes | route.ts (with method detection) | pages/api/*.ts | | Layouts | layout.tsx | N/A | | Middleware | middleware.ts (with matcher parsing) | N/A | | Dynamic routes | [id], [...slug], [[...slug]] | [id], [...slug] | | Route groups | (auth), (marketing) | N/A | | Parallel routes | @modal, @sidebar | N/A | | Intercepting routes | (.), (..), (...) | N/A | | Special files | loading, error, not-found, template | N/A |

How it works

  1. nextmap scans your filesystem for app/ and/or pages/ directories (checks src/ too)
  2. It parses the directory structure to build a route tree
  3. For API routes (route.ts), it reads the file to detect exported HTTP methods
  4. For middleware (middleware.ts), it parses matcher configuration
  5. A local Express server serves a React frontend that renders the route graph
  6. Everything runs locally — your code never leaves your machine

FAQ

No. nextmap only reads your filesystem — it doesn't start Next.js, compile your code, or import your modules. It's purely static analysis.

Yes. nextmap checks both app/ and src/app/ (same for pages/).

Not yet — planned for a future version. Currently nextmap only shows filesystem-based routes.

Yes. Use nextmap --export-svg to generate a static SVG you can embed in READMEs, docs, or wikis.

No. nextmap is a local-only tool. The server runs on localhost, the frontend is bundled static assets served from your machine. Zero network requests to external services.

Roadmap

  • [ ] next.config.js rewrites and redirects visualisation
  • [ ] File watching — live update when routes are added/removed
  • [ ] Export as PNG/PDF
  • [ ] Middleware coverage overlay

Contributing

Contributions are welcome!

git clone https://github.com/icydotdev/nextmap.git
cd nextmap
npm install
TARGET_DIR=~/your-nextjs-app npm run dev

This starts the Vite dev server (frontend) and the Express backend concurrently. TARGET_DIR points at the Next.js project to scan.

License

MIT © Sam Kavanagh