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

typemigrate

v1.0.1

Published

AST-diff upgrade transformer

Readme

typemigrate npm version npm downloads License Node TypeScript

🔀 typemigrate

Don't just detect breaking API changes — fix them. The only tool that diffs .d.ts exports between package versions and automatically rewrites your code to match.

Features · Quick Start · CLI · How It Works · vs Competitors


✨ Features

| Feature | What It Does | |:--------|:-------------| | 🔍 AST-Level Diffing | Compares exported function signatures between old and new .d.ts files using ts-morph | | ✏️ Auto-Renames | Detects renamed exports by structural signature matching — rewrites imports AND all call sites | | 🗑️ Removed API Handling | Replaces deleted-API call sites with TODO comments so your code still compiles | | 📦 Options-Wrapper Detection | When f(a, b) becomes f({ a, b }), rewrites positional args to object literals | | 🌐 Namespace Import Support | Handles import * as pkg patterns — renames, removals, and signature changes | | 🔗 Deep Re-Export Following | --deep flag follows export { ... } from './sub' into submodules | | ✅ Compilation Verification | Runs tsc --noEmit after refactoring to confirm type safety | | 🎯 Dry-Run Default | Shows what changed without touching files unless you pass --apply | | 📂 Configurable Globs | --glob / --exclude flags + tsconfig.json include fallback | | 🔒 Package Manager Aware | Detects npm/yarn/pnpm/bun — installs temp packages with your PM, copies your lockfile |


🚀 Quick Start

npm install -g typemigrate
# See what changed (safe — no files touched)
typemigrate run [email protected]

# Apply fixes automatically
typemigrate run [email protected] --apply

📖 CLI Reference

typemigrate run <pkg>@<version> [options]

# Dry-run: see what broke
typemigrate run [email protected]

# Full auto-fix with deep re-export following
typemigrate run [email protected] --apply --deep

# Target specific files
typemigrate run [email protected] --apply --glob "src/**/*.tsx" --exclude "**/*.test.tsx"

| Flag | Description | |:-----|:------------| | --apply | Apply AST changes in-place (default: dry-run only) | | --glob <pattern> | Source file glob(s) to process (repeatable) | | --exclude <pattern> | Glob pattern(s) to exclude (repeatable) | | --deep | Follow re-exports into submodules (experimental) |

Example Output

Detected 3 API Changes:
  - [Rename] oldFn -> newFn
  - [Removal] deletedFn (no matching signature found)
  - [Change] processData (signature layout modified: isomorphism:options-wrapper)

🔧 How It Works

┌────────────────────────────────────────────────────────┐
│  1. OLD VERSION                                        │
│  Parse node_modules/<pkg>/index.d.ts with ts-morph     │
│  → Collect all exported function declarations + sigs   │
├────────────────────────────────────────────────────────┤
│  2. NEW VERSION                                        │
│  Temp-install <pkg>@<target> with your PM + lockfile   │
│  → Parse new .d.ts, collect exports + signatures       │
├────────────────────────────────────────────────────────┤
│  3. STRUCTURAL DIFF                                    │
│  Match by name → detect signature changes              │
│  Match by signature → detect renames                   │
│  Unmatched old → register as removal                   │
│  Multi-param → single-obj → detect options-wrapper     │
├────────────────────────────────────────────────────────┤
│  4. AST REFACTORING                                    │
│  Named imports: rename specs + all references          │
│  Namespace imports: single-pass forEachDescendant       │
│  Removed APIs: delete statement + // TODO comment       │
│  Signature changes: prepend // WARNING comment          │
├────────────────────────────────────────────────────────┤
│  5. VERIFY                                             │
│  tsc --noEmit via your package manager                 │
│  → Reports pass/fail + first 10 error lines            │
└────────────────────────────────────────────────────────┘

[!TIP] Lockfile-aware installs. typemigrate copies your lockfile to the temp directory before installing, so transitive dependency versions match what you'd actually get.


🆚 Why typemigrate?

| Tool | Detects Changes | Auto-Fixes Code | Namespace Imports | Options-Wrapper | Re-Export Following | |:-----|:--------------:|:--------------:|:-----------------:|:---------------:|:-------------------:| | typemigrate | ✅ | ✅ | ✅ | ✅ | ✅ | | @grafana/levitate | ✅ | ❌ | ❌ | ❌ | ✅ | | vdiff-mcp | ✅ | ❌ | ❌ | ❌ | ❌ | | @evrys/tsdiff | ✅ | ❌ | ❌ | ❌ | ❌ | | typeversion | ✅ | ❌ | ❌ | ❌ | ❌ |

The difference: @grafana/levitate (10K+ weekly downloads) tells you what broke. typemigrate fixes it for you. Every other tool stops at the diagnostic. typemigrate is the only one that picks up the scalpel and rewrites your code — renames, removals, signature migrations, and even options-wrapper isomorphism detection.


📄 License

MIT · codecrypt112