Typescript
November 14, 2026 1 min read

Typescript compiler tsc

HS
HEMANT SINGH
Technical Writer & Educator

TypeScript Compiler (tsc)

tsc stands for TypeScript Compiler.

It is a command-line tool that converts TypeScript (.ts) code into JavaScript (.js) code and performs static type checking.


1. Install TypeScript

First, make sure Node.js and npm are installed.

Install TypeScript globally:

npm install -g typescript

Check the version:

tsc --version

2. Create a TypeScript file

Create a file named app.ts:

let username: string = "Hemant";
let age: number = 32;

console.log(username);
console.log(age);

3. Compile TypeScript into JavaScript

Run:

tsc app.ts

It generates a new file:

app.ts

Source

tsc app.ts

app.js

Generated


5. Useful tsc commands


Command

Purpose

tsc app.ts

Compile one file

tsc --version

Check compiler version

tsc --init

Generate tsconfig.json

tsc

Compile project using tsconfig.json

tsc --watch

Automatically recompile on changes

tsc --noEmit

Check types without generating JS

tsc --help

Show available commands