Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

check-internet-connected

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-internet-connected

Utility to check if internet is connected or not

  • 2.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.4K
decreased by-18.86%
Maintainers
1
Weekly downloads
 
Created
Source

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);

Keywords

FAQs

Package last updated on 07 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc