Socket
Book a DemoInstallSign in
Socket

hasinternet

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hasinternet

checks for internet, works in browser and node

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
2
Created
Source

hasInternet

Node.js module for checking if user is connected to the internet.

To Use

Call the function hasInternet and give it a callback function, which takes in an error and a boolean for the true/false that will return for the internet's status. IS THERE INTERNET!?!

var hasInternet = require('hasinternet')

hasInternet(answer)

function answer(err, internet) {
  // there is either an error and false for internet
  // or false for error and true for internet
	// do what you need to do with that info!
  console.log(err, internet)
}

FAQs

Package last updated on 30 Dec 2013

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