TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Node.js can now run TypeScript directly

4 点作者 uncomplexity_5 个月前

2 条评论

uncomplexity_5 个月前
So for example:<p>node --experimental-strip-types .&#x2F;src&#x2F;example.ts<p>It will now be:<p>node .&#x2F;src&#x2F;example.ts<p>Some good reads:<p>- <a href="https:&#x2F;&#x2F;nodejs.org&#x2F;en&#x2F;learn&#x2F;typescript&#x2F;run-natively" rel="nofollow">https:&#x2F;&#x2F;nodejs.org&#x2F;en&#x2F;learn&#x2F;typescript&#x2F;run-natively</a><p>- <a href="https:&#x2F;&#x2F;nodejs.org&#x2F;api&#x2F;cli.html#--experimental-strip-types" rel="nofollow">https:&#x2F;&#x2F;nodejs.org&#x2F;api&#x2F;cli.html#--experimental-strip-types</a>
dave44205 个月前
&gt; By default Node.js will execute only files that contain no TypeScript features that require transformation, such as enums or namespaces.<p>There is a further switch, not yet switched on by default, that performs these transformations.