Skip to content
A utility to to run Google Lighthouse against score budgets
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
.eslintrc
.gitignore
.lighthouserc
.node-version
.prettierignore
.prettierrc
LICENSE
README.md
index.js
package.json
yarn.lock

README.md

lighthouse-thresholds

This package runs Google Lighthouse and compares the scores against predetermined thresholds defined an a .lighthouserc config file.

Usage

Create a .lighthouserc file in your project root (see the example file here).

Run lighthouse-thresholds to run Google Lighthouse against your defined URLs and either pass or fail them when comparing with the set thresholds.

Note that there will need to be a locally installed version of chrome (or chromium), for this package to work.

Config options

Param Type Meaning
url String A full url to run Google Lighthouse against
thresholds Object An object containing the predetermined thresholds
thresholds.performance Number A threshold for the page's performance score
thresholds.seo Number A threshold for the page's performance score
thresholds.progressive Number A threshold for the page's progressive/offline score
thresholds.a11y Number A threshold for the page's accessibility score
thresholds.bestPractice Number A threshold for the page's best practice score

Example .lighthouserc file

[
  {
    "url": "https://google.com/",
    "thresholds": {
      "performance": 90.25,
      "seo": 90.25,
      "progressive": 90.25,
      "a11y": 90.25,
      "bestPractice": 90.25
    }
  }
]

Note that this file can also be .lighthouserc.js, in which case it must be in the form:

module.exports = { ...config }
You can’t perform that action at this time.