1.0.3 • Published 5 years ago

detect-connection-speed v1.0.3

Weekly downloads
15
License
MIT
Repository
github
Last release
5 years ago

detect-connection-speed

Detect connection speed with JavaScript

Install

Install with npm

$ npm install detect-connection-speed

Or install with yarn

$ yarn add detect-connection-speed
import DetectConnectionSpeed from 'detect-connection-speed';

Or umd builds are also available

<script src="path/to/detectConnectionSpeed.js"></script>

Will expose the global variable to window.DetectConnectionSpeed.

Usage

// Init
var detect = new DetectConnectionSpeed({
  url: '',
  loop: true,
  time: 1000,
  detectCallback: function(result) {
    console.log(result);
  }
});

// Destroy
detect.destroy();

License

MIT © Harvey Zack