[TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)

Posted Answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)相关的知识,希望对你有一定的参考价值。

This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file from the command line.

 

install:

npm install -g typescript

tsc -v // version 

 

app.ts:

class Person{}

 

RUN:

tsc app.ts

You will see the js file with the same name.

 

If you want a different name, you can do :

tsc --out <output_filename> <input_filename>

tsc --out bundle.js app.ts

 

Watch files changes:

tsc -w --out bundle.js app.ts

 

以上是关于[TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)的主要内容,如果未能解决你的问题,请参考以下文章

Installing CentOS 6 or RedHat EL 6 on a partition larger than 2.2T

kubernetes installing and using

typescript 泛型

TypeScript 泛型:'类型不可分配给类型 T'

TypeScript 泛型函数的类型

typescript t.ts