Node 23 will soon be able to run TypeScript files without any extra configuration.
Marco Ippolito, who has been driving TypeScript support in Node for the last year, landed a PR unflagging --experimental-strip-types
in Node 23.
Practically, this means a few things:
- You can create an
index.ts
file containing TS syntax, like type annotations. - You can run
node index.ts
with no further flags - Node will strip out the types using a version of
swc
, then run the resulting code.
Let’s treat this article as a FAQ:
How Can I Try It?
It’s now available in the Node Nightly version, as mentioned by Marco. In a few days it’ll likely get a release in Node 23.
UPDATE: Looks like it’s coming to 23.6.0.