Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. TypeScript Mastery

Lesson 1 of 56 · Typescript

Course Overview & Environment Setup

Duration: 15 minutes

Welcome to TypeScript!

In this first lesson we’ll install Node.js (v20+), npm, and the TypeScript compiler (tsc).

Install Node.js

# macOS / Linux (using Homebrew)
brew install node
# Windows (via Chocolatey)
choco install nodejs

Install TypeScript globally

npm install -g typescript

Verify installation

$ node -v
$ npm -v
$ tsc -v   # should print something like 5.2.x

Create a new project folder and initialize npm:

mkdir ts‑mastery && cd $_
npm init -y

Now add a tsconfig.json – this file tells the compiler how to emit JavaScript:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "strict": true,
    "outDir": "dist",
    "rootDir": "src",
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}

Create a src folder with a simple index.ts:

// src/index.ts
console.log('👋 Hello, TypeScript!');

Compile and run:

npx tsc   # compiles to ./dist/index.js
node dist/index.js

Tip: Use npx ts-node src/index.ts for rapid prototyping without a build step.

Info

All subsequent lessons assume this project structure.

Next: The TypeScript Compiler & tsconfig.json