Back to browse
Importree – Import Dependency Trees for TypeScript Files

Importree – Import Dependency Trees for TypeScript Files

by alexgrozav·Mar 8, 2026·1 point·0 comments

AI Analysis

●●●BangerShip ItSlick

Regex instead of AST parsing: 12ms dependency tree for 500 files versus 50ms+ for competitors.

Strengths
  • Benchmarked against madge and dep-tree with concrete numbers—3-4x faster on realistic projects.
  • Zero dependencies using only Node.js built-ins, <9kb bundle.
  • Pre-computed reverse graph enables instant cache invalidation queries.
Weaknesses
  • Niche but real use case—solves a tooling problem, not a product problem developers search for unprompted.
  • No Windows-specific edge cases mentioned; regex approach may miss complex import patterns.
Target Audience

TypeScript/JavaScript developers, build tool maintainers, monorepo teams

Similar To

madge · dependency-tree · TypeScript Compiler API

Post Description

I built a small library that builds the full import dependency tree for a TypeScript or JavaScript entry file.

Given a changed file, it tells you every file that depends on it. This is useful for things like: - selective test runs - cache invalidation - incremental builds - impact analysis when refactoring

The main focus is speed. Instead of parsing ASTs, importree scans files using carefully tuned regex, which makes it extremely fast even on large projects.

I built it while working on tooling where I needed to quickly determine which parts of a codebase were affected by a change.

Hope you'll find it as useful as I do: https://github.com/alexgrozav/importree

Happy to answer any questions!

Similar Projects

Dustoff – CLI to find and remove JavaScript/TS build artifacts

Cleans up JS build artifacts, but tree-shaking and bundlers already solve this.

Ship It
max-roma
113mo ago
Developer Tools●●Solid

Rev-dep – 20x faster knip.dev alternative build in Go

20x faster knip—performance leap is real, but dependency linters are crowded and knip already solved this.

Ship ItSolve My Problem
jayu_dev
46133mo ago