Skip to content
Latchkey

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.

tsxts-node
Engineesbuild (fast)tsc
Type checkingNo (strip only)Optional (slower)
ESM supportSeamlessWorks (config needed)
Startup speedVery fastSlower
Best forRunning scripts/tests fastType-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.

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card