TypeScript is installed via npm, providing the tsc command-line compiler (or, as of 2026, the newer Go-based tsgo in TypeScript 7.0). A tsconfig.json file at a project's root configures compiler behavior — which files to include, which JavaScript version to target, and how strict type-checking should be — and its presence is also what most editors use to provide TypeScript-aware autocomplete and error checking.
Installing and compiling
tsc compiles .ts files down to plain .js, stripping all type annotations in the process — the output is ordinary JavaScript with no trace of TypeScript syntax left in it.
$ npm install -D typescript
$ npx tsc --init // generates a starter tsconfig.json
$ npx tsc // compiles every .ts file per tsconfig.json
$ npx tsc --watch // recompiles automatically on saveA minimal tsconfig.json
strict: true enables the full family of strict type-checking rules (no implicit any, strict null checks, and more) in one flag — official TypeScript guidance recommends this for new projects, and TypeScript 6.0+ enables it by default.
{
"compilerOptions": {
"target": "es2025",
"module": "esnext",
"strict": true,
"outDir": "./dist"
},
"include": ["src/**/*"]
}Running TypeScript without a separate compile step
Modern Node.js versions can run .ts files directly for development (type-stripping the syntax at runtime, without a full type-check), and tools like ts-node and tsx have long provided similar capability — useful for quick scripts and development, though a real build step (tsc) is still the standard for producing deployable JavaScript output.