简体   繁体   English

在TypeScript项目中打开现有的Node.js项目

[英]Open existing Node.js Project in a TypeScript project

I currently have an existing project in Node.js and I would like to migrate it to a TypeScript project. 我目前在Node.js中有一个现有项目,我想将其迁移到TypeScript项目。

How can I do this? 我怎样才能做到这一点?

Thanks for the help. 谢谢您的帮助。

The easiest way to do this is to look at the Node sample provided with the TypeScript. 最简单的方法是查看TypeScript随附的Node示例。 It already includes declarations for the built-in NodeJS modules. 它已经包括内置NodeJS模块的声明。

After importing the node.js you can start by converting your modules one by one. 导入node.js之后,您可以从一个模块一个一个地转换开始。 Since the Typescript will convert into JS, you can convert one file at a time and test it right away! 由于Typescript可以转换为JS,因此您可以一次转换一个文件并立即对其进行测试!

With ambients it should be easy to do! 随着环境温度是它应该是很容易做到! Good luck with your conversion. 祝您转换顺利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM