Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 880 Bytes

README.md

File metadata and controls

50 lines (36 loc) · 880 Bytes

is-internet-present.js

Check connectivity status: Online or Offline?

⚙️ 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);
})();

Support me on Patreon - Check out my socials