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

codescope-mapper

v0.1.0

Published

Maps JavaScript and TypeScript codebases into a feature-aware dependency graph for quick understanding and navigation.

Readme

CodeScope-mapper

Codescope Mapper is a lightweight JavaScript/TypeScript repository mapper for understanding how a codebase is structured and how features connect to one another.

It scans a repository, extracts files and symbols, builds a graph of imports, calls, references, and exports, and then groups those artifacts into higher-level feature clusters.

What it does

  • Recursively scans a repository for .js, .jsx, .ts, and .tsx files
  • Ignores common irrelevant folders such as node_modules, .git, dist, build, and coverage
  • Parses source files with the TypeScript compiler API
  • Extracts functions, classes, and variables
  • Resolves local imports and symbol references
  • Builds an in-memory CodeGraph
  • Aggregates graph data into a FeatureMap for quick understanding of feature areas

Install

npm install

Usage

npm run dev -- /path/to/repository

Or after building:

npm run build
node dist/index.js /path/to/repository

CLI options

codescope-mapper /path/to/repository --summary
codescope-mapper /path/to/repository --graph
codescope-mapper /path/to/repository --json
codescope-mapper /path/to/repository --format text
codescope-mapper /path/to/repository --max-depth 5
codescope-mapper /path/to/repository --color always
codescope-mapper --help

Example output

Feature map summary
Features: 3
Files: 10
Symbols: 25
Feature relationships: 8

- auth
  files: 2
  symbols: 6
  related features: user, session

- user
  files: 3
  symbols: 9
  related features: auth

Example JSON output

codescope-mapper ./my-app --json

This returns a JSON payload with:

  • repository path
  • summary metrics
  • per-feature cluster data
  • raw graph counts

Current MVP scope

This project intentionally targets a practical subset of modern JavaScript and TypeScript repositories:

  • functions
  • classes
  • variables
  • named/default/namespace imports
  • same-file and cross-file calls
  • re-exports and export * patterns

It is intentionally not a full compiler or exhaustive code-analysis engine.

Development

npm test
npm run build
npm pack --dry-run

--color auto is the default: it colors interactive terminal output and leaves redirected output plain. Use --color always to force ANSI colors or --color never (or set NO_COLOR) to disable them. JSON output is always plain JSON.

Packaging

This project is prepared for npm publication as a lightweight CLI tool with package metadata and a bin entry.