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

structra-cli

v0.1.2

Published

AI-powered dependency graph analyzer and auto-fixer for TypeScript/JavaScript projects

Downloads

322

Readme

structra-cli

AI-powered dependency graph analyzer and auto-fixer for TypeScript and JavaScript projects.

Structra scans your codebase for dependency issues — circular dependencies, god files, layer violations, high out-degree files — and uses Claude AI to automatically fix them.

Install

npm install -g structra-cli

Requires Node.js 18+.

Quick Start

# 1. Log in with GitHub
structra login

# 2. Scan your project
structra scan ./src

# 3. Interactively fix issues
structra fix ./src

Commands

structra scan <path>

Analyzes your source directory and reports all dependency issues.

structra scan ./src

What it detects:

  • 🔴 Circular dependencies — files that import each other in a cycle (A → B → C → A)
  • 🟡 God files — files imported by too many others (default threshold: 10)
  • 🟡 High out-degree files — files that import too many others (default threshold: 15)
  • 🟡 Misplaced files — files in the wrong directory based on their name/content
  • 🟣 Layer violations — files importing from the wrong architectural layer

structra fix <path>

Interactively fix issues with AI assistance. Previews every change before applying.

structra fix ./src

# Fix only a specific issue type
structra fix ./src --type circular
structra fix ./src --type godfile
structra fix ./src --type outdegree
structra fix ./src --type layer
structra fix ./src --type misplaced

# Preview without applying changes
structra fix ./src --dry-run

# Fix all issues without prompting
structra fix ./src --all

structra report <path>

Export the scan results as an HTML or JSON report.

# HTML report (default)
structra report ./src

# JSON report
structra report ./src --format json

# Custom output path
structra report ./src --output my-report.html

structra status

Check your current plan and remaining fix quota.

structra status

structra login / structra logout

Authenticate with GitHub to enable AI-powered fixes.

structra login
structra logout

CI Mode

Use --ci to integrate with GitHub Actions or other CI pipelines. Exits with code 1 if any issues are found and outputs JSON instead of colored text.

structra scan ./src --ci

Example GitHub Actions workflow (.github/workflows/structra.yml):

name: Dependency Check
on: [push, pull_request]

jobs:
  structra:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm install -g structra-cli
      - run: structra scan ./src --ci

Config File (.structrarc)

Create a .structrarc file in your project root to customize thresholds and settings. This file is committed to git so your whole team uses the same rules.

{
  "godFileThreshold": 10,
  "outDegreeThreshold": 15,
  "layers": ["controllers", "services", "repositories", "models"],
  "exclude": ["**/*.test.ts", "**/generated/**"]
}

Pricing

| Plan | Price | Fixes | | |------|-------|-------|-| | Free | $0 | 1 fix | | | Pro | $15/month | 300 fixes/month | Upgrade → |

To upgrade, visit the link above or run structra status after logging in.

License

MIT