启用
¥Enabling
有两种方法可以在 Node.js 中启用运行时 TypeScript 支持:
¥There are two ways to enable runtime TypeScript support in Node.js:
-
对于 TypeScript 的所有语法和功能的 完全支持,包括使用任何版本的 TypeScript,请使用第三方包。
¥For full support of all of TypeScript's syntax and features, including using any version of TypeScript, use a third-party package.
-
对于轻量级支持,你可以使用对 类型剥离 的内置支持。
¥For lightweight support, you can use the built-in support for type stripping.