ping-net-check
A Node.js Module to check whether you are connected to network or not. Returns a promise resolves to true with network access and to false without network access.
Install Module
npm install ping-net-check
Note: Requires Node >= 8.0.0
Usage
With Default Options
- host: google.com
- timeout: 2000
const netCheck = ; ; // prints 'true' or 'false' depending on networking connectivity
With Options
- timeout: milliseconds
- host: string without protocol
const netCheck = ; ; // prints 'true' or 'false' depending on networking connectivity