npm.io
1.0.1 • Published 10 years ago

topmark-loadspeed

Licence
Apache-2.0
Version
1.0.1
Deps
1
Vulns
0
Weekly
0

Loadspeed

Build Status Code Climate Test Coverage Issue Count Dependency Status Inline docs npm version

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 } ]

Keywords