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

fsd-inspector

v0.1.0

Published

Visual inspector for Feature-Sliced Design projects: interactive dependency graph on React Flow with FSD rule violations

Readme

fsd-inspector

Visual inspector for Feature-Sliced Design projects: an interactive dependency graph of your layers and slices, powered by React Flow, with FSD rule violations highlighted right on the edges.

npm CI license

  • 🔍 Zero-config analysis — auto-detects the FSD root (src/ with app, pages, widgets, features, entities, shared), attributes every file to a slice, traces import/export from/import()/require between them.
  • 🧭 Alias-aware — reads paths/baseUrl from your tsconfig.json/jsconfig.json (with extends), plus the usual @/, ~/ conventions.
  • 🚨 Violation detection — upward imports and same-layer cross-imports are errors; public API bypasses (deep imports past a slice's index) are warnings.
  • 🗺 Interactive viewer — layers as rows, slices as nodes, violations as red/amber edges. Click a node to focus its links and violations.
  • 🤖 CI-friendly--json output and --fail-on-violations exit code.

Quick start

Run it in the root of any FSD project — no install needed:

npx fsd-inspector

This analyzes the project, starts a local server and opens the interactive graph in your browser.

CLI

fsd-inspector [dir] [options]

--json                 Print the dependency graph as JSON and exit
--out <file>           Write a standalone HTML report and exit
--port <n>             Port for the local viewer server (default 4573)
--no-open              Don't open the browser automatically
--fsd-root <dir>       Directory with the layer folders (default: auto-detect)
--fail-on-violations   Exit with code 1 when FSD errors are found (for CI)

Examples:

# self-contained HTML report you can attach to a PR
npx fsd-inspector --out fsd-report.html

# gate a pipeline on architecture violations
npx fsd-inspector --json --fail-on-violations > graph.json

Node API

import { analyze } from 'fsd-inspector';

const graph = analyze('./my-app');

graph.nodes; // slices: { id: 'features/auth', layer, slice, segments, files, path }
graph.edges; // aggregated deps: { source, target, imports[], violations[] }
graph.violations; // flat list: upward-import | cross-import | public-api-bypass

analyze(root, options) accepts:

| Option | Description | | ------------ | ----------------------------------------------------------------------------- | | fsdRoot | Directory with the layer folders, relative to root (auto-detected) | | extensions | File extensions to scan (default: ts/tsx/js/jsx/mjs/cjs/vue/svelte) | | ignore | Directory names to skip (default: node_modules, dist, tests, …) | | aliases | Extra alias → dir mappings on top of the tsconfig ones, e.g. { '@': 'src' } |

React component

Embed the graph in your own devtools or docs. react, react-dom and @xyflow/react are optional peer dependencies — install them alongside:

pnpm add fsd-inspector @xyflow/react
import { FsdInspector } from 'fsd-inspector/react';
import '@xyflow/react/dist/style.css';

// `graph` is the JSON produced by analyze() or `fsd-inspector --json`
export function ArchitecturePage({ graph }) {
  return (
    <div style={{ height: '100vh' }}>
      <FsdInspector graph={graph} onSelect={(node) => console.log(node?.id)} />
    </div>
  );
}

There is also a lower-level toFlow(graph) helper that converts an analyzer graph into React Flow nodes/edges with the layered layout, if you want to build a fully custom scene.

What counts as a violation

| Kind | Severity | Rule | | ------------------- | -------- | ------------------------------------------------------------------------ | | upward-import | error | A layer imports from a layer above it (e.g. entitiesfeatures) | | cross-import | error | Two slices of the same layer import each other | | public-api-bypass | warning | Deep import past a slice's index (segment indexes are OK for shared) |

License

MIT