node periksa jika tidak terhubung ke internet

let isNotConnected = !await require('dns').promises.resolve('google.com').catch(()=>{});
Bloody Booby