tsx vs ts-node for CI: Running TypeScript Faster
ts-node executes TypeScript with full tsc semantics; tsx uses esbuild to run it fast, stripping types without type-checking.
ts-node runs TypeScript via the TypeScript compiler, supporting full type-aware execution. tsx uses esbuild to transpile and run TypeScript quickly with seamless ESM support, but it does not type-check.
| tsx | ts-node | |
|---|---|---|
| Engine | esbuild (fast) | tsc |
| Type checking | No (strip only) | Optional (slower) |
| ESM support | Seamless | Works (config needed) |
| Startup speed | Very fast | Slower |
| Best for | Running scripts/tests fast | Type-aware execution |
In CI
tsx starts fast and handles ESM with little config, which is ideal for running scripts, tooling, and tests quickly in CI. ts-node can type-check as it runs, but that is slower; most pipelines instead run a fast runner like tsx and a separate tsc --noEmit step for type safety. If you only need to execute TypeScript quickly, tsx is the lighter choice.
Type-check separately
Run tsc --noEmit as its own step (in parallel) so fast execution does not skip type safety. Both run on CI runners; faster managed runners shorten long type-check passes on big codebases.
The verdict
Want the fastest way to run TypeScript scripts and tests: tsx, paired with a separate tsc --noEmit check. Need type-aware execution in one tool: ts-node. Most pipelines split fast execution from type-checking.