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

detangle

v0.2.4

Published

Fast dependency analysis and architecture rules for JavaScript and TypeScript (CLI and Node.js API)

Readme

detangle

Fast dependency analysis and architecture rules for JavaScript and TypeScript: find import cycles, enforce boundaries between parts of your code, and explore the dependency graph. Works with React, Vue, Svelte and Angular. Written in Rust on top of the oxc parser and resolver.

Website · Benchmarks · Full reference · Releases

The detangle explorer on Excalidraw: a module's imports and importers, its import cycle, and the violations and hotspots tabs

| Checking VS Code src/ (10k modules, 113k imports) | Time | Memory | |---|---|---| | detangle | 0.18 s | 156 MB | | the JavaScript rules tool | 35 s | 4.6 GB | | madge --circular | 34 s | 0.7 GB | | ESLint import/no-cycle | 289 s | 2.6 GB |

Install

npm install --save-dev detangle          # or run once: npx detangle check
brew install debug-diary-1/tap/detangle
cargo install --locked detangle

Prebuilt binaries for macOS, Linux and Windows (x64 and arm64) are on the releases page.

Quick start

detangle                # interactive explorer (shown above), updates as you edit
detangle check          # run the rules; exits 1 on errors
detangle init           # write a starter detangle.toml
detangle report --open  # HTML report

With no config, detangle check reports import cycles, unresolvable imports, undeclared npm packages and orphaned files.

Rules

Rules live in detangle.toml. Paths are regular expressions matched against paths relative to the project root.

[[forbidden]]
name = "no-circular"
severity = "warn"
to = { circular = true }

# features may not import each other
[[forbidden]]
name = "no-cross-feature"
severity = "error"
from = { path = '^src/features/([^/]+)/' }
to = { path = '^src/features/', path_not = '^src/features/$1/' }

Already using another tool?

detangle migrate --dry-run   # preview
detangle migrate             # write detangle.toml

migrate converts JavaScript rules configs, ESLint import rules (import/no-cycle, no-restricted-paths, …), Nx module boundaries, eslint-plugin-boundaries and madge. On an existing codebase, detangle check --write-baseline records today's violations so CI fails only on new ones.

In CI

With GitHub Actions, the detangle action installs the binary, annotates the pull request and writes a report to the job summary:

- uses: debug-diary-1/detangle-action@v1

Anywhere else, run it through npm: npx detangle check (exit 1 on errors), with -f github, -f markdown, -f azure or -f teamcity for that CI's annotations.

Before you commit

With pre-commit, in .pre-commit-config.yaml:

repos:
  - repo: https://github.com/debug-diary-1/detangle
    rev: v0.2.4
    hooks:
      - id: detangle

The hook runs when a source file, package.json, a tsconfig or detangle.toml is staged. With lefthook or husky, run npx detangle check (or npx detangle check --cache) in the pre-commit hook.

In your editor (experimental)

// eslint.config.js (ESLint 9 or 10)
import detangle from "detangle/eslint";

export default [/* ...your config */ detangle.configs.recommended];

Violations show on the imports that cause them as you type, including unsaved edits. Keep detangle check as the CI gate. See ESLint rules for options and limits.

Learn more

  • Full reference: every command, rule option, the explorer, groups and Nx projects, the ESLint rules, the Node.js API and the HTML report.
  • Releasing

License

Licensed under either of Apache License, Version 2.0 or MIT license, at your option.