1.0.1 • Published 8 years ago
topmark-loadspeed v1.0.1
Loadspeed
A Topmarks plugin to automate the testing of a website's loadspeed in chrome.
Installation
Install from npm npm.
npm install topmark-loadspeed
Usage
Nodejs
const Topmarks = require('topmarks');
const options = {
loadspeed: { //This will pass these options to only this plugin, alternatively you can use default for all plugins
port: 9222 //Chrome debugging port - defaults to 9222
url: 'http://topcoat.io' //url to test, defaults to http://topcoat.io
}
};
let topmarks = new Topmarks(options);
topmarks.register('topmark-loadspeed').then((results) => {
console.log(results);
}).catch((err) => {
console.log(err);
});
CLI
If using the command line tool for Topmarks it needs to be installed globally, as well as any plugins.
npm install -g topmarks topmark-loadspeed
$ topm --url http://topcoat.io --plugins topmark-loadspeed
[ { plugin: 'loadspeed',
url: 'http://topcoat.io',
timestamp: 1468518500472,
report: 0.2747849998995662 } ]
Sample Report
Should return a report similar to this:
[ { plugin: 'loadspeed',
url: 'http://topcoat.io',
timestamp: 1468518500472,
report: 0.2747849998995662 } ]