Hacker News new | past | comments | ask | show | jobs | submit login
Node.js can now run TypeScript directly (github.com/nodejs)
4 points by uncomplexity_ 3 months ago | 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.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: