TypeScript is a statically typed superset of JavaScript developed by Microsoft. Because it builds on top of JavaScript, every valid JavaScript file is also a valid TypeScript file, but TypeScript adds optional static typing, interfaces, classes, and modules to improve scalability, maintainability, and developer productivity. TypeScript code itself cannot be executed directly; instead, the TypeScript compiler transpiles it into plain JavaScript that runs in any JavaScript environment such as browsers, Node.js, or Deno.
To start using TypeScript, you install it through npm, either globally with npm install -g typescript or as a project-local development dependency with npm install typescript --save-dev. You can verify a successful installation by running tsc --version. The compiler is invoked with the tsc command: tsc file.ts compiles a single file, while running tsc alone compiles every file in the project according to the project's configuration.
Project-level configuration lives in a file called tsconfig.json. This JSON file specifies compiler options such as the target JavaScript version (for example, ES5, ES2015, or ESNext), the module system to use, and the strictness mode that governs type-checking behavior. By tailoring tsconfig.json, teams control how their TypeScript projects are compiled without having to pass flags on the command line for every build.