Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ourcodeworld/internet-available
A module to verify if there's an active internet connection with Node.js
https://github.com/ourcodeworld/internet-available
Last synced: 6 days ago
JSON representation
A module to verify if there's an active internet connection with Node.js
- Host: GitHub
- URL: https://github.com/ourcodeworld/internet-available
- Owner: ourcodeworld
- License: mit
- Created: 2017-05-23T11:40:11.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-25T07:17:06.000Z (over 3 years ago)
- Last Synced: 2024-10-04T06:39:42.689Z (about 1 month ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 18
- Watchers: 4
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# internet-available
A module to verify if there's an active internet connection with Node.js
# Installation
You can install this module through NPM using the following command in your terminal:
```bash
$ npm install internet-available --save
```# Example
internet-available requires Promises to work correctly. It's easy to use:
```javascript
var internetAvailable = require("internet-available");// Most easy way
internetAvailable({
// Provide maximum execution time for the verification
timeout: 5000,
// If it tries 5 times and it fails, then it will throw no internet
retries: 5
}).then(() => {
console.log("Internet available");
}).catch(() => {
console.log("No internet");
});
```But configurable too (check the docs).
# Documentation
[The official documentation of the project can be found in Our Code World here](http://docs.ourcodeworld.com/projects/internet-available).