New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

depwalker

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depwalker

A comprehensive TypeScript dependency analysis tool that tracks the impact of code changes, including function calls and variable usage across your codebase

latest
Source
npmnpm
Version
0.7.0
Version published
Weekly downloads
21
133.33%
Maintainers
1
Weekly downloads
 
Created
Source

🚶‍♂️ DepWalker

npm version npm downloads Node.js Version License Pipeline

A TypeScript dependency analysis tool that tracks the impact of code changes. DepWalker analyzes Git changes and shows which functions are affected, along with their dependency chains.

🎯 Use Cases

  • Impact Analysis: Understand which functions are affected by your changes
  • Pre-commit Review: See the scope of impact before committing changes
  • Test Planning: Identify which parts need testing after modifications
  • Refactoring Safety: Verify dependencies when refactoring shared code
  • Code Review: Share impact analysis as Markdown or HTML with your team

🧠 How It Works

DepWalker analyzes your TypeScript codebase in 4 steps:

┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│  1. Detect  │ →  │  2. Parse   │ →  │  3. Analyze │ →  │  4. Report  │
│   Changes   │    │    Code     │    │ Dependencies│    │   Results   │
└─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘
  • Detect Changes — Runs git diff to find files and line numbers you've modified
  • Parse Code — Uses the TypeScript Compiler API to build an AST of your entire codebase
  • Analyze Dependencies — Maps function calls to build a complete call graph, then traces which functions are affected by your changes
  • Generate Report — Renders the impact analysis as Markdown or interactive HTML

📦 Installation

Prerequisites: Node.js (v18+) and Git

Run without installing using your preferred package runner:

# npm
npx depwalker@latest

# pnpm
pnpm dlx depwalker@latest

# bun
bunx depwalker@latest

🚀 Usage

Run DepWalker in your TypeScript project with uncommitted changes:

# Basic usage - outputs Markdown report
npx depwalker@latest

# Interactive HTML visualization (auto-opens browser)
npx depwalker@latest --format html

# Using bunx instead of npx
bunx depwalker@latest --format html

# HTML with custom output path (auto-opens browser)
npx depwalker@latest --format html --output impact-report.html

# HTML without auto-opening browser
npx depwalker@latest --format html --no-open

# Limit analysis depth
npx depwalker@latest --depth 3

# Custom tsconfig location
npx depwalker@latest --tsconfig ./custom-tsconfig.json

# Save to file
npx depwalker@latest --output impact-report.md

Example Output

# Impact Analysis

**2 files changed · 5 nodes**
🟠 1 high · 🟡 2 medium · 🟢 1 low · ⚪ 1 none

## Changed Nodes

| Node            | File                       | Impact | Dependents | Depth |
| --------------- | -------------------------- | ------ | ---------- | ----- |
| **handleClick** | `src/components/Button.tsx:23` | 🟠 12  | 8          | 2     |
| **formatDate**  | `src/utils/helpers.ts:10`  | 🟡 6   | 4          | 1     |

## Test Targets

| Test Target | File                            | Depth    | Covers               |
| ----------- | ------------------------------- | -------- | -------------------- |
| `main`      | `src/index.ts:1`               | 1 level  | `handleClick`        |
| `App`       | `src/App.tsx:5`                 | 3 levels | `handleClick`        |

2 test targets

🔧 Options

OptionDescriptionDefault
-f, --format <format>Output format: markdown, htmlmarkdown
-d, --depth <n>Maximum analysis depthNo limit
-t, --tsconfig <path>TypeScript config path./tsconfig.json
-o, --output <file>Save report to fileAuto-generated
--no-openDon't auto-open HTML report in browser(auto-opens)

Output Formats

  • markdown (default): Compact, scannable report with a changed nodes table and test targets list. Great for sharing with AI assistants or pasting into PRs.
  • html: Single-page static report with collapsible dependency trees per changed node, impact badges, and a test targets table. Everything visible on one page — no clicking required. Automatically opens in browser (use --no-open to disable).

Limitations

  • TypeScript only — Requires valid TypeScript (or JavaScript with @ts-check)
  • Static analysis — Cannot trace dynamic calls (e.g., const fn = 'foo'; eval(fn)())
  • Template literal imports — Dynamic imports with template strings (import(\./${x}`)`) are not resolved
  • Git dependency — Requires a git repository with uncommitted changes to analyze
  • Single project — Does not analyze cross-package dependencies in monorepos

Impact Scoring

Impact Score = Dependents + (Depth × 3)

LevelScoreDescription
🔴 Critical20+Extreme impact - changes ripple through many levels
🟠 High10-19Significant impact
🟡 Medium4-9Moderate impact
🟢 Low1-3Minimal impact
⚪ None0No external callers

🔌 Plugin Architecture

DepWalker uses a plugin-based architecture for output formats. Want to add JSON, CSV, or your own custom format? See CONTRIBUTING.md for a step-by-step guide to creating plugins.

🤝 Contributing

Quick Start for Contributors

git clone https://github.com/razrinn/depwalker.git
cd depwalker && pnpm install
git checkout -b feature/my-feature
# Make changes
pnpm changeset  # Add changeset
pnpm build      # Test build
git commit -m "feat: description"
git push origin feature/my-feature
# Create PR

Release Process (Fully Automated)

StepWhoAction
1ContributorAdd changeset + PR
2MaintainerMerge PR
3CICreate "Version Packages" PR
4MaintainerMerge "Version Packages" PR
5CIAuto-publish to npm + create tag

See CONTRIBUTING.md and RELEASE.md for details.

📄 License

ISC License - see LICENSE

Made with ❤️ by Ray Azrin Karim

Keywords

typescript

FAQs

Package last updated on 22 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts