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 🙏

© 2025 – Pkg Stats / Ryan Hefner

codebase-index

v1.0.3

Published

CLI tool for quick summarization of JavaScript/TypeScript codebases with symbol extraction

Downloads

15

Readme

Codebase Index

A CLI tool for quick summarization of JavaScript/TypeScript codebases. Get an instant overview of all files and their exported symbols.

☢️ This codebase was almost entirely generated by LLM agent. I expect there is may be some issues. This is more or less poor man's quick and hacky solution to code summarization.

🚀 Quick Start

# Analyze current directory
npx codebase-index .

# Analyze specific directory
npx codebase-index my-project

# Use the simplified command
npx mindex .

Example output:

🔍 Mini-Index: Analyzing /Users/jin/dev/mini-index/test-samples

- advanced_python.py: VERSION, DEBUG, CONFIG_PATH, StatusEnum, UserData, authenticate_user, get_user_profile, async_fetch_data, DatabaseManager, static_utility_function, process_data, outer_function, result
- api/
  - route.ts: POST, GET
- components.jsx: ChatInterface, ErrorBoundary, Footer
- django_app.py: DEBUG, ALLOWED_HOSTS, DATABASE_URL, UserViewSet, ProductManager, dashboard_view, async_data_processor, calculate_price, format_currency
- sample.py: API_VERSION, DEBUG_MODE, get_user_data, process_payment, UserManager, PaymentProcessor
- types.ts: User, Message, DEFAULT_CONFIG, ChatState
- user.js: generateUserId, getCurrentUser, createUser, updateUserActivity

📦 Installation

# Global installation
npm install -g codebase-index

# Or use directly with npx
npx codebase-index .

✨ Features

  • 📁 Directory Analysis: Recursively scans JavaScript/TypeScript projects
  • 🔍 Symbol Extraction: Finds all exported functions, classes, types, and interfaces
  • 🎯 Multi-Format Support: JavaScript (ES6/CommonJS), TypeScript, JSX/React
  • 🌳 Tree Output: Clean, readable file structure with exported symbols
  • ⚡ Fast & Lightweight: Quick analysis of entire codebases
  • 🛡️ Error Handling: Graceful handling of parsing errors

🎯 Use Cases

  • Code Reviews: Get a quick overview of what a project exports
  • Documentation: Generate file structure for documentation
  • Onboarding: Help new developers understand codebase structure
  • Refactoring: Identify unused exports and dependencies
  • Architecture: Visualize project organization

📋 Sample Output

🔍 Mini-Index: Analyzing /path/to/project

- api/
  - route.ts: POST, GET
- components/
  - ChatInterface.jsx: ChatInterface, ErrorBoundary
  - Footer.jsx: Footer
- lib/
  - types.ts: User, Message, ChatState
  - utils.js: generateId, formatDate
- models/
  - user.py: UserManager, get_user_data, authenticate_user
- user.js: getCurrentUser, createUser, updateUser

🛠️ Supported File Types

| Format | Support Level | Features | |--------|---------------|----------| | JavaScript (ES6) | ✅ Full | Named/default exports, arrow functions | | JavaScript (CommonJS) | ✅ Full | module.exports, exports.* | | TypeScript | ✅ Enhanced | Interfaces, types, classes, functions | | JSX/React | ✅ Enhanced | Components, props detection | | Python | ✅ Enhanced | Functions, classes, variables (AST-based) | | JSON | ✅ Basic | File listing |

🎮 CLI Commands

# Main commands
npx codebase-index [directory]     # Full analysis
npx mindex [directory]         # Simplified command

# Examples
npx mindex .                   # Current directory
npx mindex src                 # Src folder only
npx mindex ../other-project    # Different project

📚 Programmatic API

const { EnhancedAnalyzer } = require('codebase-index');

const analyzer = new EnhancedAnalyzer();
const result = analyzer.analyzeProject('./my-project');
console.log(result);

🔧 Configuration

Mini-index automatically skips common directories:

  • node_modules/
  • .git/
  • .next/
  • dist/
  • build/

🤝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT License - see LICENSE file for details.

🎉 Why Codebase Index?

Perfect for:

  • Tech Leads reviewing code structure
  • Developers exploring new codebases
  • Documentation teams generating overviews
  • Architects understanding project organization
  • Anyone who needs a quick "what does this export?" answer

Get started in seconds: npx mindex .