https://github.com/jlord/hasinternet
checks for internet, works in browser and node
https://github.com/jlord/hasinternet
Last synced: 5 months ago
JSON representation
checks for internet, works in browser and node
- Host: GitHub
- URL: https://github.com/jlord/hasinternet
- Owner: jlord
- License: other
- Created: 2013-04-13T17:25:30.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-02-18T02:34:19.000Z (almost 12 years ago)
- Last Synced: 2025-08-09T07:41:54.406Z (5 months ago)
- Language: JavaScript
- Size: 136 KB
- Stars: 59
- Watchers: 9
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# 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!?!
```javascript
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)
}
```