TypeScript Get Started
Install Node.js, then npm install -g typescript. Write hello.ts, compile with tsc hello.ts and run the JavaScript with node hello.js. Runners such as tsx and Bun run TypeScript directly.
Example
// Terminal:
// npm install -g typescript
// tsc hello.ts && node hello.js
const msg: string = "Hello World";
console.log(msg);Result
Hello World
Exercise
Compile a file.
hello.tsQuiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.