is-internet-present
v1.0.0
Published
Check connectivity status: Online or Offline?
Downloads
3
Maintainers
Readme
⚙️ Installation
npm i is-internet-present
📖 Usage
◎ Import
// ES6
import isInternetPresent from "is-internet-present";
// commonjs
const isInternetPresent = require("is-internet-present");
◎ Examples
(async () => {
const online = await isInternetPresent();
console.log('Online:', online);
})();
isInternetPresent().then(online => {
console.log('Online:', online);
});
Change host (where the request gets sent)
(async () => {
const online = await isInternetPresent('www.google.com');
console.log('Online:', online);
})();