Skip to content

A simple tool to crawl a sitemap and produce a PageSpeed Insight Score for each page

License

Notifications You must be signed in to change notification settings

gabrielduque/webperf-lib-psi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webperf-lib-psi

A simple tool to crawl a sitemap and produce a PageSpeed Insight Score for each page

You can use the module as follows:

var onErrorCb = function(err) {
  console.log('There was an error while running the script: '+err);
};
var onCompleteCb = function() {
  console.log('Run completed successfully');
};
var onResultCb = function(url, type, data) {
  console.log('onResult for URL: '+url);
};

PSILib.on('onResult', onResultCb);

PSILib.on('onError', onErrorCb);

PSILib.on('onCompleted', onCompleteCb);

PSILib.crawlSitemap(sitemapUrl);

The onResultCb gives you the URL it scored, the type will be 'psi' and the data takes the form of:

  • data.score
    • PageSpeed Insights Score
  • data.formattedResults.ruleResults
    • An Array of rules which PageSpeed was looking at.

About

A simple tool to crawl a sitemap and produce a PageSpeed Insight Score for each page

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%