Run TypeScript code without worrying about configuration

25 nailer 19 7/17/2025, 5:29:46 PM tsx.is ↗

Comments (19)

cellis · 6m ago
It really is the worst name, unsearchable and so overloaded. But it's been an awesome tool. I hope they rename it.
chmod775 · 1h ago
That's some terrible naming. Now there's two things "tsx" stands for in the TypeScript ecosystem.
VPenkov · 12m ago
Been using tsx for years. This had never occurred to me, but you're right
subarctic · 57m ago
Yup. But it's useful so I use it
hu3 · 24m ago
I was curious about how it works.

It seems to be a wrapper for esbuild that transpiles typescript then calls your local node (it doesn't bundle nodejs).

From https://tsx.is/faq :

"tsx: Uses esbuild for fast compilation and does not perform type checking."

From https://tsx.is/node-enhancement :

"Under the hood, tsx calls node. This means the Node.js features supported in tsx depend on the Node.js version you have installed."

jauco · 1h ago
Newer versions of node can run typescript directly[1]. The one where types are simply stripped is considered stable[2] (but you can’t use syntax that node doesn’t understand, such as enums).

They’re working on making features work that require some transpilation as well

[1]: https://nodejs.org/en/learn/typescript/run-natively [2]: https://github.com/nodejs/node/pull/58643

lacoolj · 21m ago
lol the timing of these two posts (this and https://news.ycombinator.com/item?id=44597966) feel deliberate
fjcero · 1h ago
Use bun
danscan · 47m ago
Came here to say this :)
molszanski · 1h ago
I love tsx. Lately I’ve been also using bun for the same purpose.
spankalee · 1h ago
Does this just pass the --experimental-strip-types flag to node?
joshuaturner · 22m ago
With node24, no flag needed. These tools are really great and I'm happy to see improvement in the space, but I'm even happier to be able to start getting rid of them with native node improvements.
webstrand · 1h ago
Last I knew, it did the transpilation itself so that it could handle module path resolution manually.
basetensucks · 1h ago
It does more, it also includes a compatibility layer allowing you to require ESM packages in CJS. It's quite handy!
andrus · 1h ago
Don’t recent Node.js releases support this already? require(esm) was back ported to Node.js 20 in February
postalrat · 2h ago
The JavaScript version can be called jsx.
cacozen · 1h ago
The HTML version can be called HTMX
SwiftyBug · 38m ago
The Java SE version can be called Java SEX.
monarchwadia · 2h ago
I do love tsx.