01. Installation of TypeScript native compiler

The installation command is npm install -g typescript
Successful installation will install two commands tsc (compile) and tsserver in the global directory
 The file of Hello.ts is
export class Hello{
	
}
 
Run the command in the directory of Hello.ts
tsc Hello.ts
Generate Hello.js, the code is
"use strict";
exports.__esModule = true;
var Hello = /** @class */ (function () {
    function Hello() {
    }
    return Hello;
}());
exports.Hello = Hello;
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326171526&siteId=291194637