Plate 77
tsx vs ts-node: Which Should You Use? 0.49s vs 1.18s
tsx 4.23.15 vs ts-node 10.9.2 on TypeScript 5.9.2 for a 50k-row script: medians 0.49 s vs 1.18 s (typecheck) vs 0.38 s (--transpile-only) vs 0.13 s precompiled node. TypeScript 7.0.2 crashes ts-node 10.9.2; tsx runs. Who should switch.
Aditya Challa4 min read
On TypeScript 5.9.2, a 50,000-row script started in a median 0.49 s under tsx 4.23.15 and 1.18 s under ts-node 10.9.2 (type-checking mode). The same script under ts-node --transpile-only took 0.38 s. Precompiled node dist/script.js took 0.13 s.
Short answer: switch to tsx for day-to-day script and test runners, especially if you plan to touch TypeScript 7 — ts-node 10.9.2 crashed on TypeScript 7.0.2 in my probe (ts.sys.fileExists undefined). Keep ts-node only if you need its type-check-on-run workflow and you stay on TypeScript 5.x. No affiliate links in this post.
What I tested
- Machine: 8 vCPU Intel Xeon / 15 GB RAM Linux cloud box, Node 20.19.2, tested 5 Oct 2026 (about 22:50 to 23:00 IST). Shared box; runners interleaved each round.
- Script: local
script.tsthat builds 50,000 row objects, reduces sum/avg/max, prints one line. No network, no filesystem beyond stdout. - Primary stack: TypeScript 5.9.2, tsx 4.23.15, ts-node 10.9.2. Invoked via local
node_modules/.bin(notnpx) so installer lookup is out of the clock. - Timing: five interleaved cold process starts each after warmup. Median wall-clock for the whole process.
- TypeScript 7 probe: separate folder with TypeScript 7.0.2 + the same tsx and ts-node versions. tsx printed the summary; ts-node threw
TypeError: Cannot read properties of undefined (reading 'fileExists')inside its config loader. - One surprise:
ts-node --transpile-only(0.38 s) beat tsx (0.49 s) on this script. Full ts-node with typecheck (1.18 s) was the slow one. - Not tested: ESM-only projects, path aliases, monorepo project references, watch mode, Windows/macOS, IDE integration, bun's TypeScript runner.
Is tsx faster than ts-node?
| Runner | Mode | Median | Runs (ms) |
|---|---|---|---|
| tsx 4.23.15 | transpile + run | 0.49 s | 488 / 504 / 522 / 483 / 486 |
| ts-node 10.9.2 | typecheck + run | 1.18 s | 1438 / 1435 / 1111 / 1152 / 1179 |
| ts-node 10.9.2 | --transpile-only | 0.38 s | 378 / 418 / 368 / 503 / 370 |
| node (tsc output) | precompiled | 0.13 s | 139 / 148 / 134 / 127 / 124 |
tsx was about 2.4x faster than typechecking ts-node and about 1.3x slower than ts-node --transpile-only on this workload. If your ts-node habit is already --transpile-only (or SWC compiler host), do not expect a big win from swapping brands — pick based on TypeScript 7 readiness and DX instead.
Precompiled node still wins when the script is stable. Use a runner for tools, codegen, and tests you edit every minute; compile for anything that runs in CI every push without source changes. The TypeScript 7 upgrade decision is the companion post if the language version is the real question.
Does ts-node work on TypeScript 7?
Not in my probe. With TypeScript 7.0.2 installed next to ts-node 10.9.2, ts-node script.ts died while reading config (ts.sys was undefined). The same folder with tsx 4.23.15 ran the script and printed 50000:499.50:999. Treat that as a blocker for any "upgrade TypeScript first, keep ts-node" plan until upstream catches up.
For test runners the adjacent decisions on this site are Vitest 5: should you upgrade and jsdom vs happy-dom under Vitest. Those measure the test host; this post measures how you launch the TypeScript file itself.
Should you switch from ts-node to tsx?
| Situation | My pick |
|---|---|
| Scripts and Vitest/Jest setup files on TypeScript 5.x | Prefer tsx; simpler default |
| About to move to TypeScript 7 | Prefer tsx; re-check ts-node before you rely on it |
You already use ts-node --transpile-only and stay on TS 5 | Optional; speed is close |
| You want type errors to fail the script on every run | Stay on typechecking ts-node (TS 5 only), or run tsc --noEmit in CI |
| Production long-running service | Compile with tsc (or your bundler); do not ship a TS runner |
Bottom line: on a 50k-row script, tsx started in 0.49 s versus 1.18 s for typechecking ts-node, and TypeScript 7.0.2 crashed ts-node while tsx ran. Who should not switch yet: teams that need on-run typechecking and are pinned to TypeScript 5. Everyone else can take tsx for scripts and keep tsc for the compile gate.
How this was made: I wrote the script, ran every cold start on the ShopperCove test box, probed TypeScript 7 in a separate folder, and kept the timing JSON; the write-up was drafted with AI help and checked against that output.
Sources
- https://tsx.is/
- https://typestrong.org/ts-node/docs/
- https://www.npmjs.com/package/tsx
- https://www.npmjs.com/package/ts-node
- https://www.typescriptlang.org/docs/handbook/typescript-tooling-in-5-minutes.html
- https://devblogs.microsoft.com/typescript/
Related
- https://www.shoppercove.com/blog/typescript-7-should-you-upgrade
- https://www.shoppercove.com/blog/vitest-5-should-you-upgrade-october-2026
- https://www.shoppercove.com/blog/jsdom-vs-happy-dom-vitest
- https://www.shoppercove.com/blog/nodejs-26-lts-october-2026-schedule-change
- https://www.shoppercove.com/blog/bun-1-4-2-elysia-als-cmyk-jpeg-october-2026
- https://www.shoppercove.com/blog/pnpm-vs-npm-vs-bun
- https://www.shoppercove.com/blog/playwright-1-63-test-locks-october-2026
- https://www.shoppercove.com/blog/vite-plus-1-0-unified-toolchain-october-2026
Lab evidence
What I found running this
Hands-on on ShopperCove box 5 Oct 2026 ~22:50-23:00 IST (8 vCPU Intel Xeon / 15 GB shared Linux, Node 20.19.2). Script: 50000-row summarize TypeScript file. Primary versions: TypeScript 5.9.2, tsx 4.23.15, ts-node 10.9.2; invoked via node_modules/.bin. Wall medians (5 interleaved cold starts after warmup): tsx 487.734 ms (488/504/522/483/486); ts-node typecheck 1178.916 ms (1438/1435/1111/1152/1179); ts-node --transpile-only 378.312 ms (378/418/368/503/370); node dist/script.js 134.142 ms (139/148/134/127/124). TS7 probe: TypeScript 7.0.2 + ts-node 10.9.2 threw TypeError reading ts.sys.fileExists; tsx 4.23.15 on the same folder printed 50000:499.50:999. Raw: /workspace/bench-tsrun/res-tsrun.json. Not tested: ESM-only, path aliases, project references, watch mode, Windows/macOS, bun runner. No affiliate.
Related links
Plate 74
ncu vs npm outdated: 4 Majors Beyond Wanted
npm-check-updates 23.1.0 vs npm outdated on 7 stale deps (axios/eslint/lodash/prettier/react/typescript/vite): ncu proposed 4 majors (React 19, Vite 8, TypeScript 7, ESLint 10) while npm Wanted stayed in-range; wall medians 863 ms vs 783 ms.
5 Oct 2026
Plate 93
Vite vs Parcel: 0.69s vs 1.72s Cold Dev Start
Vite 7.3.6 vs Parcel 2.16.4 on a 40-page React 19 TS fixture (147 modules): cold serve-ready median 692 ms vs 1,718 ms (~2.5x); cold prod build wall median 2,586 ms vs 1,806 ms; JS 228,426 B vs 227,172 B with Parcel --no-source-maps.
5 Oct 2026
Plate 80
nock vs msw: Should You Switch? 2.9ms vs 0.5ms
nock 14.0.17 vs msw 2.15.0 on 2,000 sequential mocked fetch calls in Node 20: 2.85 ms vs 0.49 ms per request (~5.8x); via axios 3.80 ms vs 1.41 ms (~2.7x). nock sets up faster (97 vs 208 ms), crossover near 50 requests per process.
5 Oct 2026