next-mahine-rsc-inspector
v1.0.4
Published
Inspect and analyze Next.js React Server Components architecture
Maintainers
Readme
🚀 Overview
Next Mahine RSC Inspector is a comprehensive analysis tool designed to help developers understand and optimize their Next.js App Router architecture. It provides detailed insights into React Server Components (RSC) usage, component distribution, and performance patterns.
Whether you're auditing a codebase, optimizing performance, or ensuring best practices, this tool gives you the visibility you need into your Next.js application's architecture.
✨ Features
📊 Client vs Server component count Instantly see how many components run on the client and how many run on the server.
🧠 RSC architecture insights Understand how your App Router is structured and how components interact.
⚡ Performance-oriented analysis Identify patterns that may impact bundle size or rendering performance.
🧩 Component distribution overview Visualize how components are spread across your application.
📊 Comprehensive Analysis
- ✅ Automatic detection of
app/orsrc/directories - ✅ Accurate classification of Server vs Client Components
- ✅ Folder-by-folder statistics for detailed insights
- ✅ Percentage ratios for quick assessment
🛠️ Multiple Output Formats
- ✅ Visual CLI reports with progress bars and colored output
- ✅ JSON export for integration with other tools
- ✅ File output for saving reports
- ✅ Programmatic API for custom integrations
🔧 Developer Experience
- ✅ Zero-configuration - works out of the box
- ✅ TypeScript support with full type definitions
- ✅ Fast execution with minimal dependencies
- ✅ Cross-platform support (Windows, macOS, Linux)
exemple:
📦 Quick Start
Method 1: Quick Run (No Installation)
npx next-mahine-rsc-inspector
Method 2: Local Installation
npm install next-mahine-rsc-inspector --save-dev
npx next-mahine-rsc-inspector
Method 3: Global Installation
npm install -g next-mahine-rsc-inspector
next-mahine-rsc-inspector
JSON Output
# Export as JSON to console
npx next-mahine-rsc-inspector --json
# Save JSON report to file
npx next-mahine-rsc-inspector --json -o report.json
# Combine folder stats with JSON
npx next-mahine-rsc-inspector --by-folder
Output Examples
Visual Report
{
"projectName": "my-nextjs-app",
"projectRoot": "/path/to/project",
"appDir": "/path/to/project/src",
"folders": {
"app": { "server": 5, "client": 2 },
"components": { "server": 3, "client": 12 },
"components/ui": { "server": 1, "client": 8 }
},
"total": 31,
"client": 22,
"server": 9,
"ratioServer": 29,
"ratioClient": 71
}
MIT License
Copyright (c) 2026 Mahaman Mahine Kamagaté
created: 26/01/2026