check-internet-connected

2.0.6 • Public • Published

check-internet-connected

A node module that does a TCP connection to check whether we are connected to Internet or not

Usage:-

npm install check-internet-connected

const checkInternetConnected = require('check-internet-connected');
checkInternetConnected()
  .then((result) => {
    console.log(result);//successfully connected to a server
  })
  .catch((ex) => {
    console.log(ex); // cannot connect to a server or error occurred.
  });
Additional Config
const config = {
  timeout: 5000, //timeout connecting to each server, each try
  retries: 5,//number of retries to do before failing
  domain: 'https://apple.com',//the domain to check DNS record of
}
checkInternetConnected(config);

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.66,352latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.66,352
2.0.51,299
2.0.41
2.0.31
2.0.11
2.0.01
1.1.21
1.1.11
1.1.01
1.0.01

Package Sidebar

Install

npm i check-internet-connected

Weekly Downloads

7,659

Version

2.0.6

License

MIT

Unpacked Size

3.99 kB

Total Files

4

Last publish

Collaborators

  • aankur