1.0.4 ā€¢ Published 2 years ago

internet-status v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

internet-status

A lightweight utility that finds out and outputs internet connection status on a browser

NPM JavaScript Style Guide

Install

npm install --save internet-status

Usage

import React from "react";

import InternetStatus from "internet-status";

const App = () =>{
  <InternetStatus
  pingIntervalInSeconds="15",
  idealInternetSpeed="5", // Mbps
  slowInternetSpeed="1", // Mbps
  // Default image values
  testImageUrl = "https://res.cloudinary.com/dnsuxxqz1/image/upload/app/OE8Ie4TRdJgqyUGHCu8TDnzYIQH5TEoX.jpg",
  testImageSizeInBytes = "98715" />;
  }
PropOptions
pingIntervalInSecondsPing interval in seconds / how often do you wanna check Status
idealInternetSpeedWhat is the ideal internet speed (Any speed above ideal is a šŸŸ¢ )
slowInternetSpeedWhat is the slow internet speed (Any speed above slow is šŸŸ )
testImageUrlUrl of a image preferably on your server, this will be used to check the speed
testImageSizeInBytesSize of the test image

Output

šŸŸ¢ If internet connection is ideal
šŸŸ  If internet connection is slow
šŸ”“ If internet connection is less than slow or offline

License

MIT Ā© Srivatsa-Rao