Thuta Learning
ရှာဖွေရန်
BasicWeb Developmentbeginner

What is Node.js?

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

Node.js ဆိုတာ JavaScript ကို browser အပြင်ဘက်မှာ run လုပ်နိုင်အောင်လုပ်ပေးတဲ့ runtime environment ဖြစ်ပါတယ်။ Browser ထဲမှာ JavaScript က button click, animation, form validation လို frontend အလုပ်တွေလုပ်တယ်။ Node.js ကတော့ server ပေါ်မှာ file ဖတ်ခြင်း၊ database ချိတ်ခြင်း၊ API ပြန်ပေးခြင်း၊ automation script run ခြင်းလို backend အလုပ်တွေကို JavaScript နဲ့လုပ်နိုင်စေပါတယ်။

javascript
// Save this as intro.js
const message = "Node.js runs JavaScript outside the browser.";
const currentYear = new Date().getFullYear();

console.log(message);
console.log(`Learning Node.js in ${currentYear}`);

ဒီ code မှာ string message တစ်ခုသိမ်းပြီး console.log() နဲ့ terminal ထဲကို output ထုတ်ပါတယ်။ Browser console မဟုတ်ဘဲ Terminal/Command Prompt မှာ node intro.js နဲ့ run ရတာကို သတိထားပါ။

You should see
Node.js runs JavaScript outside the browser. Learning Node.js in 2026

Info

new Date() လို JavaScript built-in object တွေကို Node.js မှာလည်း သုံးနိုင်ပါတယ်။ ဒါပေမဲ့ browser-specific object တွေကိုတော့ မသုံးနိုင်ပါ။

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • node intro.js မဟုတ်ဘဲ file ကို double-click နှိပ်ရင် expected output မမြင်ရနိုင်ပါ။ Node.js file တွေကို terminal ကနေ run လုပ်တာကို အကျင့်လုပ်ပါ။

လေ့ကျင့်ခန်း

Small utility script, data formatter, log checker, simple API server စတာတွေကို Node.js နဲ့ရေးနိုင်ပါတယ်။

You'll know it worked when:

What is Node.js? | Thuta Learning