测试ts代码的时候 为了方便 不用tsc去编译 直接用ts-node去联调ts代码
安装typescript
npm install -g typescript
//$ tsc -v
//Version 3.2.2

安装ts-node npm官方地址https://www.npmjs.com/package/ts-node
npm install -g ts-node

demo.ts文件
const test1:number =1;
console.log(test1);

终端输入
ts-node demo.ts
//注意ts文件路径 比如ts-node D:/project1/testTs.ts
//终端打印出 1



网友评论