tsx
TypeScript and ESM runtime enhancement for Node.js using esbuild. tsx (TypeScript Execute) is ts-node's faster replacement — uses esbuild for near-instant TypeScript transpilation without type-checking. Supports TypeScript, TSX/JSX, and ESM/CommonJS interop. Significantly faster startup than ts-node because it skips type checking. Ideal for scripts and tools where speed matters.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local execution only. esbuild transpiler has excellent security track record. No telemetry.
⚡ Reliability
Best When
You need fast TypeScript script execution without type-checking overhead — tsx is the modern replacement for ts-node in most use cases.
Avoid When
You need type-checking during execution (use ts-node with type checking enabled) or production deployment (compile to JavaScript).
Use Cases
- • Run TypeScript scripts with instant startup: tsx script.ts — 10-50x faster than ts-node for frequently-run scripts
- • Execute TypeScript in watch mode for development: tsx watch server.ts — auto-restarts on file changes
- • Use as Node.js --loader for loading TypeScript modules without compilation in development and CI
- • Run TypeScript test files and scripts in CI where type-checking is handled separately by tsc --noEmit
- • Replace ts-node in package.json scripts for faster developer experience: 'start': 'tsx src/index.ts'
Not For
- • Type checking — tsx transpiles only, no type checking; run tsc separately for type validation
- • Production runtime — transpile to JavaScript for production deployments; tsx is a development/scripting tool
- • Complex TypeScript decorator metadata — tsx uses esbuild which has limited decorator metadata support
Interface
Authentication
No authentication — local runtime tool.
Pricing
MIT-licensed open source tool.
Agent Metadata
Known Gotchas
- ⚠ tsx does not type-check — TypeScript type errors are silently ignored; run tsc --noEmit separately for type checking in CI
- ⚠ Decorator metadata (emitDecoratorMetadata) is not fully supported — TypeGraphQL, TypeORM, and libraries requiring metadata reflection may not work correctly
- ⚠ ESM and CommonJS interop requires care — tsx handles most cases but circular dependencies with mixed module formats can cause unexpected resolution issues
- ⚠ tsconfig paths are resolved via tsconfig.json — tsx reads tsconfig.json automatically from the project root; non-standard tsconfig locations require --tsconfig flag
- ⚠ tsx watch mode (tsx watch file.ts) restarts the whole process on change — not hot module replacement; stateful applications lose state on reload
- ⚠ tsx is a Node.js enhancer — it cannot be used for browser TypeScript execution; browser-targeted code should use Vite, esbuild, or similar bundlers
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for tsx.
Scores are editorial opinions as of 2026-03-06.