README
Speed Test
An embeddable speed test powered by SamKnows.
Installation
$ npm install --save speedtest
Usage
var initSpeedTest = require('speedtest');
var speedTest = initSpeedTest({
el: '#speedtest',
width: 800,
height: 370
});
The speed test will adjust to fit in the space given to it - even small ones. If a width and height are not specified in the options, it will attempt to use the width and height of the specified element.
There are a few other options, too:
primary
: The colour of the needle.secondary
: The colour of the button and gauge.lang
: Hard code a different language. Generally not needed - defaults to browser language.
The speed test emits an event when a speed test is complete, containing data about the test:
speedTest.on('complete', function (results) {
console.log(results);
});
License
Released under the MIT license.