Node.js ကျူတိုရီရယ်

Node.js ပင်မစာမျက်နှာ Node.js နိဒါန်း Node.js ကို စတင်လိုက်ပါ။ Node.js မော်ဂျူးများ Node.js HTTP မော်ဂျူး Node.js ဖိုင်စနစ် Node.js URL မော်ဂျူး Node.js NPM Node.js ပွဲများ Node.js ဖိုင်များ အပ်လုဒ်လုပ်ခြင်း။ Node.js အီးမေးလ်

Node.js MySQL

MySQL စတင်လိုက်ပါ။ MySQL ဒေတာဘေ့စ်ဖန်တီးပါ။ MySQL ဇယားဖန်တီးပါ။ MySQL ထဲသို့ ထည့်သွင်းပါ။ MySQL မှ ရွေးချယ်ပါ။ MySQL ဘယ်မှာလဲ။ MySQL Order By MySQL ကိုဖျက်ပါ။ MySQL Drop Table MySQL အပ်ဒိတ် MySQL ကန့်သတ်ချက် MySQL Join

Node.js MongoDB

MongoDB စတင်လိုက်ပါ။ MongoDB ဒေတာဘေ့စ်ဖန်တီးပါ။ MongoDB သည် Collection ကိုဖန်တီးပါ။ MongoDB ထည့်သွင်းပါ။ MongoDB ကိုရှာပါ။ MongoDB မေးခွန်း MongoDB အမျိုးအစား MongoDB ကိုဖျက်ပါ။ MongoDB Drop Collection MongoDB အပ်ဒိတ် MongoDB ကန့်သတ်ချက် MongoDB Join

Raspberry Pi

RasPi စတင်လိုက်ပါ။ RasPi GPIO နိဒါန်း RasPi မှိတ်တုတ်မှိတ်တုတ် LED RasPi LED နှင့် ခလုတ်နှိပ်ပါ။ RasPi စီးဆင်းနေသော LED များ RasPi WebSocket RasPi RGB LED WebSocket RasPi အစိတ်အပိုင်းများ

Node.js အ ကိုး အကား

Built-in Modules များ

Node.js Assert Module

❮ Built-in Modules


ဥပမာ

ဖော်ပြချက်တစ်ခုသည် 0 သို့မဟုတ် false သို့ အကဲဖြတ်ပါက အမှားအယွင်းတစ်ခု ချလိုက်ပြီး ပရိုဂရမ်ကို ရပ်ဆိုင်းလိုက်သည်-

var assert = require('assert');
assert(5 > 7);

အဓိပ္ပါယ်နှင့် အသုံးပြုမှု

အခိုင်အမာ module သည် အသုံးအနှုန်းများကို စမ်းသပ်သည့်နည်းလမ်းကို ပံ့ပိုးပေးသည်။ စကားရပ်သည် 0 သို့ အကဲဖြတ်ပါက၊ အမှားအယွင်းတစ်ခု ဖြစ်ပေါ်နေပြီး ပရိုဂရမ်ကို ရပ်စဲသွားမည်ဖြစ်သည်။

ဤ module ကို Node.js မှ အတွင်းပိုင်းတွင် အသုံးပြုရန် တည်ဆောက်ထားပါသည်။


အထားအသို

သင့်အပလီကေးရှင်းတွင် အခိုင်အမာ မော်ဂျူးကို ထည့်သွင်းခြင်းအတွက် အထားအသို-

var assert = require('assert');

နည်းလမ်းများကို အခိုင်အမာ

Method Description
assert() Checks if a value is true. Same as assert.ok()
deepEqual() Checks if two values are equal
deepStrictEqual() Checks if two values are equal, using the strict equal operator (===)
doesNotThrow()  
equal() Checks if two values are equal, using the equal operator (==)
fail() Throws an Assertion Error
ifError() Throws a specified error if the specified error evaluates to true
notDeepEqual() Checks if two values are not equal
notDeepStrictEqual() Checks if two values are not equal, using the strict not equal operator (!==)
notEqual() Checks if two values are not equal, using the not equal operator (!=)
notStrictEqual() Checks if two values are not equal, using the strict not equal operator (!==)
ok() Checks if a value is true
strictEqual() Checks if two values are equal, using the strict equal operator (===)
throws()  

❮ Built-in Modules