Проверка узлов, если не подключено к Интернету

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