vs code 使用 typings 对nodejs 代码进行提示

1. 安装 typings

npm install typings -g

2. 创建一个文件夹存放 typings 的引用文件: for example:

    c:/ typings

3. 在文件夹中 打开git bash,输入命名:

typings install dt~node --global --save

4. 在你需要提示的文件开头写上:

/// <reference path="C:/typings/typings/index.d.ts" />

5. OK! 现在你已经可以使用 nodejs 的智能提示了。 

6. 别的文件, 重复步骤4! OK!

7. 别的xxx模块:在上面的c:/typings文件夹内使用 

typings install xxx --save

具体可参考:http://www.cnblogs.com/IPrograming/p/VsCodeTypings.html

猜你喜欢

转载自my.oschina.net/linhos/blog/1818152
今日推荐