ourcodeworld / internet-available

A module to verify if there's an active internet connection with Node.js
MIT License
18 stars 6 forks source link

upgrade to ESM #5

Open mesqueeb opened 3 years ago

mesqueeb commented 3 years ago

see a checklist here https://github.com/sindresorhus/meta/discussions/15

jclaveau commented 2 years ago

This one works with ESM https://github.com/jd1378/is-internet-available

import { isInternetAvailable, InternetAvailabilityService } from 'is-internet-available'

const googleIsReachable = await isInternetAvailable({ authority: 'https://accounts.google.com' });
if (! googleIsReachable) {
  ...
}