Simple repository for training on TypeScript
- started by the folks at Microsoft, as a way to make JavaScript scale easily for large applications.
- Some Caveats of Typescript:
-
Its a superset of JavaScript, with the introduction of types
-
It compiles back into JavaScript which your browser can understand
-
Given that it compiles back into plain JavaScript, you need a compiler
- through NPM:
npm install -g typescript
- Use terminal and the TypeScript Compiler
- tsc stands for TypeScript compiler
- Syntax:
tsc fileName.ts
tsc folderName
This will compile the typescript file or all TS files in that folder into JavaScript files, with the same name
-
You can also install the compiler into your favorite IDE and build from there
-
For actual projects, this will be included in your build system or build tool - so that you will have browser ready JavaScript for your project
- VS Code: has in-built support for building and intellisense for TS
- Sublime Text: Install the TypeScript Package from Package Control Sublime Text TypeScript Package
- Atom: Install the TypeScript package for Atom from apm: Atom package for TypeScript