TypeScript is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the playground, and stay up to date via our blog and Twitter account.
- Basic Types
- Objects
- Functions
- Classes
- Interfaces
- Generics
- Excercices
For the latest stable version:
npm install -g typescript
tsc --init
-
- As nodemon or sass it keeps watching for changes
tsc --watch
{
"compilerOptions": {
"sourceMap": true, // To see references in ts (console.log) but generate a new .map file for each ts
"target": "es5", // es2016 not as used as es5
"moduleResolution": "node" // Specify how TypeScript looks up a file from a given module specifier.
"removeComments": true
},
"exclude": [
"//objects/*.ts",
"node_modules"
]
}