- 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
推薦閱讀
- 物聯(lián)網(wǎng)與北斗應(yīng)用
- CorelDRAW X6 中文版圖形設(shè)計實戰(zhàn)從入門到精通
- 網(wǎng)絡(luò)協(xié)議工程
- C++黑客編程揭秘與防范
- 物聯(lián)網(wǎng)識別技術(shù)
- 物聯(lián)網(wǎng)網(wǎng)絡(luò)安全及應(yīng)用
- 網(wǎng)絡(luò)故障現(xiàn)場處理實踐(第4版)
- TCP/IP入門經(jīng)典(第5版)
- Building RESTful Web services with Go
- 智慧光網(wǎng)絡(luò):關(guān)鍵技術(shù)、應(yīng)用實踐和未來演進
- 6G:面向2030年的移動通信
- 局域網(wǎng)組成實踐
- TCP/IP基礎(chǔ)(第2版)
- 5G非正交多址接入技術(shù):理論、算法與實現(xiàn)
- 計算機網(wǎng)絡(luò)技術(shù)