# What changed in import-in-the-middle

> 34 changes in import-in-the-middle 2 to 3 from its official release notes, upgrade guides and advisories: 1 breaking, 3 new APIs and options. Each one cited. Sources checked 2026-10-21. HTML: https://unstale.sh/npm/import-in-the-middle/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## import-in-the-middle 3

### Breaking changes

- Support for Node.js versions below 18 has been dropped. (3.0.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.0.0)

### New APIs and options

- CJS source stripping can now be disabled. (3.4.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.4.0)
- Adds a predicate for matching consumer-owned modules. (3.2.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.2.0)
- Adds synchronous loader hooks via module.registerHooks. (3.1.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.1.0)

### Performance

- Reduces ESM wrapper allocations, improving performance. (3.5.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.5.0)
- Replaces acorn with es-module-lexer for ESM parsing. (3.3.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.0)
- Shrinks generated wrapper source. (3.3.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.0)

### Behavior and default changes

- Adds support for es-module-lexer v3, allowing developers to use that version with import-in-the-middle. (3.5.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.5.0)
- Instrumentation now supports type-stripped TypeScript modules. (3.3.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.0)

### Fixes and other changes

- Duplicate TypeScript export names are removed. (3.5.2) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.5.2)
- Restores compatibility with legacy bundlers. (3.5.1) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.5.1)
- TypeScript is stripped after loaders normalize the format. (3.3.3) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.3)
- Code generation is skipped on broken maglev. (3.3.2) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.2)
- Loader URLs are escaped in generated wrappers. (3.3.2) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.2)
- Tagged modules are delegated to their owning loader. (3.3.2) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.2)
- Guards against circular recursion when processing export-star declarations. (3.3.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.0)
- Keeps get-esm-exports synchronous so require() continues to work. (3.3.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.0)
- Resolves re-exported values from the module where they are defined. (3.3.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.3.0)
- Updated proxying logic for builtins used as CJS. (3.0.2) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.0.2)
- File specifiers from turbopacked packages are handled better. (3.0.1) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v3.0.1)

## import-in-the-middle 2

### Performance

- Improves performance by calculating fewer stack frames and using fast paths. (2.0.3) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.3)

### Fixes and other changes

- Fixes issues with duplicate entries. (2.0.6) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.6)
- The callback name argument is now the module name when matching the module main file, including when the internals option is used. (2.0.6) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.6)
- Builtin modules that require the node: prefix are now properly hooked. (2.0.6) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.6)
- Fixes issues with specifier (submodule) matching. (2.0.6) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.6)
- Recognizes the entrypoint as CommonJS when loader chains add query params to file URLs. (2.0.5) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.5)
- Handles lazy initialization and circular dependencies. (2.0.5) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.5)
- Top-level modules are no longer instrumented. (2.0.4) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.4)
- Removes a small memory leak. (2.0.3) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.3)
- No longer crashes when setters are missing. (2.0.3) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.3)
- Handles undefined exports properly. (2.0.3) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.3)
- Properly handles internals when the specifier matches. (2.0.2) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.2)
- Properly hooks submodule package exports. (2.0.1) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.1)
- Modules running in the loader thread were converted to ESM to work around loader issues. (2.0.0) — [release notes](https://github.com/nodejs/import-in-the-middle/releases/tag/import-in-the-middle-v2.0.0)
