Tech TutorBangla Web Documentation
Portfolio
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • TypeScript Documentation28টি অধ্যায়
প্রযুক্তি নির্বাচন
HomeHTMLCSSTailwind CSSJavaScriptTypeScriptReactNext.jsNode.jsExpressSocket.IOExpoWordPressPostgreSQLPrismaPostgresNestJSMongoDBDockerTanStackTanStack TableRTK QueryGitGitHub
  • Introduction
  • Installation
  • Basic Types
  • Variables & Inference
  • Functions
  • Objects
  • Type Alias
  • Interface
  • Union & Intersection
  • Type Narrowing
  • Type Guards
  • Enums
  • Generics
  • Classes
  • Utility Types
  • Type Assertion
  • Async TypeScript
  • Conditional Types
  • Mapped Types
  • Template Literal Types
  • tsconfig Options
  • Modules & Types
  • Decorators
  • React + TypeScript
  • Node.js + TypeScript
  • JS → TypeScript
  • Common Errors
  • Mini Project
  1. Docs
  2. TypeScript
  3. TypeScript Installation ও Setup
TypeScriptBeginner

TypeScript Installation ও Setup

Node.js-এ TypeScript install, tsc compiler, tsconfig.json সেটআপ এবং প্রথম TypeScript program — ধাপে ধাপে বাংলায়।

15টি অংশবাংলা ভাষায়

TypeScript চালাতে প্রথমে লাগে Node.js। তারপর একটি কমান্ডেই TypeScript install হয়। চলুন শুরু থেকে দেখি।

Installation

globally বা project-wise — দুই ভাবেই install করা যায়। প্রজেক্টে চাইলে -D (dev dependency) হিসেবে রাখা ভালো, কারণ শুধু develop/compile-এর সময়ই compiler দরকার।

# Global install (যেকোনো জায়গা থেকে tsc চালানো যায়)
npm install -g typescript

# অথবা শুধু একটি প্রজেক্টে
npm init -y
npm install --save-dev typescript

# pnpm ব্যবহার করলে
pnpm add -D typescript

TypeScript Compiler (tsc)

Install নিশ্চিত করতে tsc --version আর প্রথম ফাইল compile করতে npx tsc ব্যবহার করুন। npx চালালে project-এর local compiler ব্যবহার হয়।

tsc --version

# একটি ফাইল compile করুন
npx tsc hello.ts

# ফাইল বদলানো মাত্র আবার compile (watch mode)
npx tsc -w hello.ts

tsconfig.json

tsconfig.json হলো TypeScript-এর নিয়মের ফাইল — কোন ফাইল include করবে, কোন target-এ compile করবে, strict কিনা — সবকিছু এখানে। npx tsc --init দিলে ডিফল্ট একটি তৈরি হয়ে যায়।

tsconfig.jsonjson
json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "commonjs",
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true
  },
  "include": ["src"]
}
অপশনকাজ
targetকোন JS সংস্করণে compile হবে (ES2022, ES5...)
moduleকোন module system (commonjs, esnext...)
strictঅনেক কঠোর টাইপ নিয়ম একসাথে সক্রিয়
outDiroutput ফাইল কোথায় যাবে
rootDirsource ফাইল কোথায় পড়বে
includeকোন ফাইল/ফোল্ডার compile হবে

প্রথম TypeScript Program

hello.tstypescript
typescript
function greet(name: string): string {
  return "স্বাগতম, " + name;
}

const message = greet("রহিম");
console.log(message);
npx tsc hello.ts   # → hello.js তৈরি হবে
node hello.js        # → স্বাগতম, রহিম
উন্নত অভিজ্ঞতার জন্য

বড় প্রজেক্টে tsc -w watch mode চালু রাখুন — ফাইল save করলেই auto compile হয়। Node.js-এ দ্রুত run করতে tsx ব্যবহার করতে পারেন, এটি এক কমান্ডেই TS চালায়।

শেষ প্যারায় নিজে practice করুন — কোড কপি করে নিজের এডিটরে চালিয়ে দেখুন।
আগেরTypeScript IntroductionপরেরTypeScript Basic Types (প্রাথমিক টাইপ)
এই পেজে
Tech Tutor

বাংলায় ওয়েব ডেভেলপমেন্ট ডকুমেন্টেশন শিখুন — ধাপে ধাপে।

Homeসব ডকুমেন্টেশনQuick Startআমার নোটস

© 2026 Tech Tutor. বাংলায় শিখুন, বাংলায় গড়ুন।

mdanamolhasan1998@gmail.com