ping-net-check

1.2.1 • Public • Published

Build Status Known Vulnerabilities GitHub license Twitter

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 } = require('ping-net-check');
    netCheck().then(value => console.log(value));
    // prints 'true' or 'false' depending on networking connectivity

With Options

  • timeout: milliseconds
  • host: string without protocol
    const { netCheck } = require('ping-net-check');
    netCheck({
        timeout: 3000,
        host: 'example.com'
    }).then(value => console.log(value));
    // prints 'true' or 'false' depending on networking connectivity

Package Sidebar

Install

npm i ping-net-check

Weekly Downloads

3

Version

1.2.1

License

MIT

Unpacked Size

5.97 kB

Total Files

4

Last publish

Collaborators

  • syed_umair