Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Node.js can now run TypeScript directly (github.com/nodejs)
4 points by uncomplexity_ on Dec 28, 2024 | hide | past | favorite | 2 comments


So for example:

node --experimental-strip-types ./src/example.ts

It will now be:

node ./src/example.ts

Some good reads:

- https://nodejs.org/en/learn/typescript/run-natively

- https://nodejs.org/api/cli.html#--experimental-strip-types


> By default Node.js will execute only files that contain no TypeScript features that require transformation, such as enums or namespaces.

There is a further switch, not yet switched on by default, that performs these transformations.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: