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

structdecipher

v1.1.0

Published

Visualize React/TypeScript project architecture — dependency graphs, layer classification, circular deps, FSD support

Readme

StructDecipher

Instantly visualize the architecture of any React/TypeScript project. Zero config — just run npx structdecipher and get an interactive dependency graph in your browser.

Quick Start

npx structdecipher

That's it. Opens a dashboard showing your project's dependency graph, layer classification, API endpoints, and circular dependencies.

Features

  • Dependency Graph — Interactive React Flow visualization with drag, zoom, and pan
  • Layer Classification — Automatically groups files into Pages, Components, Hooks, Services, Utils, Store, Types, Config
  • Circular Dependency Detection — Highlights cycles with DFS + Tarjan's SCC
  • API Endpoint Tracking — Detects fetch/axios/openapi-fetch/openapi-ts calls
  • Dead Code Detection — Finds unreachable files via BFS tree-shaking
  • Impact Analysis — Click any node to see what depends on it

Framework Support

| Framework | Detection | File-based Routing | |---|---|---| | React (CRA / Vite) | ✅ | — | | Next.js (pages & app) | ✅ | ✅ | | Remix | ✅ | ✅ | | TanStack Router | ✅ | ✅ | | Gatsby | ✅ | ✅ | | Feature-Sliced Design | ✅ | ✅ (violations) |

Monorepo Support

Automatically detects npm/yarn/pnpm workspaces and scans all packages.

Usage

# Scan current directory, open dashboard
npx structdecipher

# Scan a specific project
npx structdecipher ./my-react-app

# Output JSON to stdout (no server)
npx structdecipher . --json

# Save structure to file
npx structdecipher . -o structure.json

# Custom port
npx structdecipher . --port 4000

# Don't auto-open browser
npx structdecipher . --no-open

Options

| Flag | Short | Description | |---|---|---| | --json | -j | Output JSON to stdout, no server | | --output <file> | -o | Write JSON to file | | --port <port> | -p | Server port (default: 5173) | | --no-open | | Don't open browser automatically | | --help | -h | Show help |

Programmatic API

import { scanRepository } from "structdecipher";

const result = scanRepository("./my-project");

console.log(result.nodes);       // File nodes with layer info
console.log(result.edges);       // Import relationships
console.log(result.analytics);   // Circular deps, dead files, dependents
console.log(result.metadata);    // Framework, scan time, file counts

Output Structure

{
  "nodes": [
    {
      "id": "src/App.tsx",
      "label": "App",
      "layer": "component",
      "filePath": "src/App.tsx",
      "lineCount": 42,
      "hasDefaultExport": true,
      "apiCalls": ["/api/users"],
      "routes": ["/dashboard"]
    }
  ],
  "edges": [
    { "source": "src/App.tsx", "target": "src/hooks/useAuth.ts" }
  ],
  "analytics": {
    "circularDeps": [],
    "deadFiles": ["src/utils/deprecated.ts"],
    "scc": [],
    "dependents": {}
  },
  "metadata": {
    "framework": "nextjs",
    "analyzedFiles": 85,
    "totalEdges": 142,
    "scanTimeMs": 12
  }
}

Requirements

  • Node.js >= 18

License

MIT