reference
TypeScript Tutorial | Noob Tutorial
introduce
TypeScript is an open source programming language developed by Microsoft , built by adding static type definitions to JavaScript . TypeScript is translated into JavaScript code by the TypeScript compiler or Babel, which can run on any browser and any operating system .
TypeScript is a superset of JavaScript that supports the ECMAScript 6 standard ( ES6 Tutorial ).
TypeScript is a free and open source programming language developed by Microsoft.
The design goal of TypeScript is to develop large-scale applications, which can be compiled into pure JavaScript, and the compiled JavaScript can run on any browser.
Install
1. For the environment where nodejs and npm are installed for the first time, please refer to
Nodejs Getting Started and Technical Guide - Cloud Flame's Blog - CSDN Blog
2. NPM install TypeScript
$ npm install -g typescript
Check the installed version
$ tsc -v
Build your first Typescript program
$ vi app.ts
var message:string = "Hello World"
console.log(message)
Convert TypeScript to JavaScript code:
$ tsc app.ts
After execution, the current directory generates app.js
Execute the app.js file with the node command:
$ node app.js