TypeScript Environment Setup

TypeScript Environment Setup
Install Required Tools
Make sure these are installed:
Node.js (includes npm)
TypeScript
Code Editor (recommended: Visual Studio Code)
You already installed TypeScript in the previous step.
Check:
Install Visual Studio Code (VS Code)
Download and install VS Code.
Recommended VS Code Extensions
ESLint
Prettier – Code Formatter
JavaScript and TypeScript Nightly (optional)
(VS Code has built-in TypeScript support)
Create a TypeScript Project
Create a new folder and open it in VS Code.
Initialize npm:
Install TypeScript locally:
Create tsconfig.json
Run:
This creates tsconfig.json, which controls how TypeScript behaves.
Important tsconfig.json Options
Project Folder Structure
Recommended structure:
Write Your First TypeScript Code
Create src/index.ts
Compile the Project
Compile all .ts files:
JavaScript output will be generated inside dist/.
Run the Output
Output:
Watch Mode (Auto Compile)
Automatically compile on file change:
Environment Setup Summary
| Step | Tool |
|---|---|
| Runtime | Node.js |
| Package Manager | npm |
| Compiler | TypeScript (tsc) |
| Editor | VS Code |
| Config File | tsconfig.json |
You Are Ready!
Your TypeScript environment is now fully set up
