- Hands-On Full Stack Web Development with Angular 6 and Laravel 5
- Fernando Monteiro
- 165字
- 2021-07-23 19:18:48
Installing TypeScript
It's pretty simple to install and get started with TypeScript. It is necessary to have Node.js and Node Package Manager (NPM) installed on your machine.
If you don't have them yet, go to https://nodejs.org/en/download/ and follow the step-by-step installation instructions for your platform.
Let's install TypeScript, as follows:
- Open your Terminal and type the following command to install the TypeScript compiler:
npm install -g typescript
Note that the -g flag means to install the compiler on your machine globally.
- Let's check the available TypeScript commands. Type the following command in the Terminal:
tsc --help
The preceding command will provide a lot of information about the TypeScript compiler; we will see a simple example of how we can transpile a TypeScript file to a JavaScript file.
Examples:
tsc hello.ts
tsc --outFile file.js file.ts
Descriptions of the preceding lines are as follows:
- The tsc command compiles the hello.ts file.
- Tell the compiler to create an output file, named hello.js
推薦閱讀
- 黑客攻防實戰技術完全手冊:掃描、嗅探、入侵與防御
- EDA技術與VHDL編程
- SEO 20日
- GPS/GNSS原理與應用(第3版)
- 萬物互聯:蜂窩物聯網組網技術詳解
- Wireshark網絡分析就這么簡單
- 計算機網絡工程實用教程(第2版)
- 沖擊:5G如何改變世界
- Implementing NetScaler VPX?
- 云工廠:開啟中國制造云時代
- 5G非正交多址接入技術:理論、算法與實現
- Laravel Application Development Cookbook
- 商業的本質和互聯網
- 工業以太網技術:AFDX/TTE網絡原理、接口、互連與安全
- Architecting Data:Intensive Applications