Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

internet-available

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

internet-available

A module to verify if there's an active internet connection with Node.js

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
188
decreased by-60.67%
Maintainers
1
Weekly downloads
 
Created
Source

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:

$ npm install internet-available --save

Example

internet-available requires Promises to work correctly. It's easy to use:

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.

Keywords

FAQs

Package last updated on 23 May 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc