npm / tsx
tsx
What changed in tsx 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
tsx 439 changes
Performance 5
The CLI loads esbuild lazily, improving CLI startup performance.
Node TypeScript formats are mapped directly for improved performance.
Synchronous module hooks are used on Node v22.22.3 and newer.
The transform cache is indexed lazily, improving startup or cache-related performance.
Avoids redundant filesystem probes during module resolution, improving resolution efficiency.
Fixes and other changes 34
Bare builtins are excluded from namespace inheritance.
Namespaced register overloads are portable for declaration emit.
require.cache and require.extensions are exposed to tsImport CommonJS modules.
Restores the CJS bridge namespace for Node 24 require(esm) when using tsImport.
Shared transform cache memory is now bounded, preventing unbounded cache growth.
Fixes shimming import.meta when tokens are split by comments or newlines.
Preserves the async ESM require fallback behavior for developers using tsx.
tsx now supports nyc coverage discovery, improving coverage collection when using nyc.
Node test locations are mapped correctly, improving location reporting for developers running tests.
tsImport now supports data URLs, allowing TypeScript imports from data URL sources.
Package subpath resolution is preserved, preventing incorrect module resolution for package subpaths.
Typeless ESM dependency exports are preserved, improving compatibility when resolving ESM dependencies without an explicit type.
Prevents cache collisions in tsImport.
Node resolution is preserved when allowJs is enabled.
Resolver URL metadata is now composed correctly.
Resolver URL metadata is now preserved.
Detects when the Node inspector is enabled through NODE_OPTIONS.
Async process.once() signal handlers are now allowed to finish when using the CLI.
Preserves listenerCount overload semantics for developers using the API.
Watch mode exits with 128 plus the signal number when interrupted.
tsImport now works after a global preload.
Watch mode no longer clears piped output.
Watch mode now treats script and dependency paths literally.
Hook state is now isolated per async module.register() registration, preventing state from being shared across registrations.
CommonJS directory requires inside dependencies are now resolved correctly.
Typed loader source is decoded correctly during tsx execution.
Entrypoints are preserved when TypeScript preload hooks are used.
Preserves CommonJS JSON require behavior when using ESM hooks.
Adds support for require and ESM interoperability involving module.exports.
Preserves named exports from CommonJS TypeScript modules.
Resolves tsconfig path aliases containing a colon correctly.
Import.meta paths are supported on Node 20.11 and 21.2.
Adds support for Node.js 24.15.0.
Adds support for Node.js 26.1.0 and 25.9.0.