TypeScript ကိုစတင်ရန် သင့် computer တွင် Node.js နှင့် npm install လုပ်ထားရန် လိုအပ်သည်။
Local Setup အဆင့်များ:
1. Terminal (Command Prompt) ကိုဖွင့်ပြီး TypeScript Compiler (tsc) ကို install လုပ်ပါ:
npm install -g typescript
2. app.ts نامی file အသစ်တစ်ခု ပြုလုပ်ပြီး TypeScript code ရေးပါ။
3. Terminal တွင် tsc app.ts ဖြင့် compile လုပ်ပါ။ ၎င်းသည် app.js file အသစ်တစ်ခုကို generate လုပ်ပေးပါမည်။
4. node app.js ဖြင့် ထွက်လာသော JavaScript file ကို run ပါ။
typescript
# 1. Install TypeScript globally
npm install -g typescript
# 2. Create a file named app.ts
# 3. Compile the TypeScript file
tsc app.ts
# 4. Run the resulting JavaScript file
node app.jsYou should see
(Official TypeScript Playground တွင် ဤ setup အဆင့်များမလိုဘဲ တိုက်ရိုက်စမ်းသပ်နိုင်သည်)