TypeScript compiler for Windows can be installed in following way.
1. Instalation guid
- Ensure that NodeJS and npm are installed (installation and running instruction is here).
- Open some terminal as administrator, e.g. Bash (installation struction is here).
- Install TypeScript compiller with command:
$ npm install -g typescript
-gflag means global installation.
2. *.ts compilation guid
- Create Script.ts file:
for(let i = 0; i < 5; ++i) console.log('Hello world!');
$ tsc Script.ts
Note: after compliation Script.js file should be created.
- Run compiled program
$ node Script.js
Hello world! Hello world! Hello world! Hello world! Hello world!