npm / jiti
jiti
What changed in jiti 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
3 breaking13 new APIs and options2 performance3 behavior and defaults3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjiti 224 changes
Breaking changes 3
Use the named export instead of the default export when importing
createJiti.Resolves modules with ESM resolution; it accepts try and other resolve options and is consistent with
import.meta.resolve.Imports modules through the native ESM path, supporting top-level await and native importing of ES-only modules.
New APIs and options 13
Adds support for using and await using.
Adds the jiti/static subpath.
Adds opt-in support for tsconfigPaths.
Adds support for virtual modules.
Enables inspection of jiti internals; the output is more readable and uses colors to help find slow imports.
ESM modules can be evaluated with a fallback loader.
Support was added for
import.meta.resolve.Enables debug output with
JITI_DEBUG=1.Configures
interopDefaultthrough an environment variable.Provides the jiti API while depending only on runtime
import.meta.resolveand dynamicimport()support.Registers jiti globally using experimental Node.js global hooks, either with
node --importor a programmatic import.Enables direct importing of
.jsxand.tsxfiles when set to true; JSX support is opt-in.Supported through native ESM importing.
Performance 2
Caching reduces proxy overhead by about 2x.
Overhead of jiti sub-instances was reduced.
Behavior and default changes 3
jiti handles
data:imports.The package exports are available in both ESM and CJS formats for importing jiti in ESM contexts.
When
node_modulesexists, jiti stores caches there instead of using a temp directory, making them easier to inspect locally.
Fixes and other changes 3
Adds a fallback for ENAMETOOLONG when evaluating ESM.
Passes resolve options through require.
Falls back to transpilation when tryNative fails.