Next.js Introspect
A comprehensive Next.js project introspection tool that analyzes routing structures, detects framework configurations, and provides detailed metadata about your Next.js application.
Next.js Introspect
A comprehensive Next.js project introspection tool that analyzes routing structures, detects framework configurations, and provides detailed metadata about your Next.js application.
🚀 Quick Start
Install globally for CLI usage:
npm install -g next-introspect
# or
bun add -g next-introspectAnalyze your Next.js project:
Using global installation:
next-introspect introspect . --format typescript --output routes.tsOr run without global installation:
# Using bunx
bunx next-introspect introspect . --format typescript --output routes.ts
# Using npx
npx next-introspect introspect . --format typescript --output routes.tsUse in your code:
import { routes } from './routes';
const postUrl = routes.blog.posts.byId({ id: "123" });
// → "/blog/posts/123"✨ Features
- Framework Detection: Automatically detects Next.js projects and router types (App Router, Pages Router, or both)
- Route Analysis: Comprehensive analysis of all routes including dynamic routes, API routes, and special pages
- Multiple Output Formats: Export results as JavaScript objects, JSON, or Markdown documentation
- Analysis Modes: Choose between basic, detailed, or comprehensive analysis levels
- App Router Support: Full support for Next.js 13+ App Router with special files, route groups, and metadata
- Pages Router Support: Complete analysis of traditional Pages Router with API routes and data fetching
- Configuration Parsing: Extracts Next.js configuration and project metadata
- CLI Tool: Command-line interface for quick analysis and file export
- Watch Mode: Continuously monitor for file changes and auto-re-analyze
- TypeScript: Full TypeScript support with comprehensive type definitions
📚 Documentation
CLI Usage
Learn how to use the command-line interface
Programmatic API
Use next-introspect in your code
Output Formats
Explore different output formats
Configuration
Customize analysis options
🛠️ Installation
Global Installation (CLI)
bun add -g next-introspect
# or
npm install -g next-introspectLocal Installation (Programmatic)
bun add next-introspect
# or
npm install next-introspect