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

codemap-index

v1.0.0

Published

Auto-generate .codemap/ index files for AI coding tools. Maps features to files, endpoints, and flows — zero config.

Downloads

16

Readme

codemap-index

Auto-generate .codemap/ index files for AI coding tools. Maps features to files, endpoints, and flows — zero config.

Built to help AI assistants (Claude Code, Cursor, Copilot) navigate your codebase efficiently by reading a small index file instead of scanning hundreds of files.

Install

npm install -g codemap-index

Usage

Run from your project root:

# Auto-discover features and generate .codemap/ files
codemap generate

# Check for stale file references
codemap validate

How it works

  1. Scans backend/controllers/ — each controller becomes a feature
  2. Auto-groups controllers by prefix (SupplierController + SupplierActivityControllersupplier)
  3. Traces backend dependencies via constructor injection (controllers → services → models)
  4. Matches frontend files by keyword (pages, services, components, store)
  5. Extracts API endpoints from controller route attributes
  6. Preserves manually written flow descriptions across regenerations

Output

Each feature gets a .codemap/{feature}.json file:

{
  "feature": "trial",
  "description": "trial (1 controller(s), 7 files)",
  "key_files": [
    "backend/controllers/TrialController.cs",
    "backend/services/TrialService.cs",
    "backend/Models/User.cs",
    "frontend/src/services/trialService.js"
  ],
  "endpoints": [
    "POST /api/trial/claim",
    "GET /api/trial/eligibility"
  ]
}

Merge groups

Create .codemap/groups.json to merge related features:

{
  "billing": ["subscription", "membership", "invoice"]
}

This combines all files and endpoints from subscription, membership, and invoice into a single billing.json codemap.

Why use this?

| Without codemap | With codemap | |----------------|-------------| | AI scans 50+ files to find relevant code | AI reads 1 JSON file (~20 lines) | | ~10,000 tokens per question | ~5,000 tokens per question | | Slow, expensive, often misses files | Fast, cheap, complete coverage |

Supported stacks

Currently optimized for:

  • Backend: .NET / ASP.NET Core (controllers, services, models)
  • Frontend: React / Vite (pages, services, components, store)

The architecture is extensible — PRs welcome for other frameworks.

Programmatic API

const { generateCodemaps, resolveFiles, traceImportChain } = require('codemap-index');
const { autoDiscover, generateAutoCodemaps } = require('codemap-index/src/auto-discover');

// Auto-discover and generate
generateAutoCodemaps('/path/to/project', '.codemap');

// Or use individual functions
const files = resolveFiles(['backend/controllers/Trial*'], rootDir);
const allFiles = traceImportChain(files, rootDir, 3);

License

MIT