This app takes URLs and optional metadata from input.csv (one row per URL), runs one or more audits synchronously, and outputs median scores to output.csv.
You can specify multiple different options using the flags below.
For example:
- The number of times Lighthouse tests each URL. The default is three.
- Whether to calculate the average or median scores for all the runs. The default is median.
- Which Lighthouse audits to run. The default is all audits: Performance, Best practice, PWA, Accessibility, SEO.
- Clone the code using git:
git clone git@github.com:samdutton/multihouse.git
or download it as a ZIP file. - From a terminal window, go to to the
multihouse
directory you created and runnpm install
to install the required Node modules. - Add URLs to be audited (and optional metadata) to input.csv, as described below.
- From a terminal
cd
to thesrc
directory and runnode index.js
, optionally setting the flags below. - Progress updates and errors will be logged to the console.
- When all Lighthouse runs are complete, view the results in output.csv.
- Check for errors in error-log.txt.
Each line in input.csv begins with a URL, optionally followed by other comma-separated data for the URL.
For example:
My site,homepage,https://example.com
Results are written to output.csv with one line per URL. For example:
My site,homepage,https://example.com,0.50,0.38,0.78,0.87,1
input.csv and output.csv in this repo both include real example data.
- Lighthouse runtime errors are logged in error-log.txt.
- Any audit that returns a zero score is disregarded, and a warning for the URL and score is logged in error-log.txt.
- URLs with Lighthouse errors are not included in output data.
-a, --append Append output to existing data in output file
-c, --categories Audits to run: one or more comma-separated values,
default is:
performance,pwa,best-practices,accessibility,seo
-f, --flags One or more comma-separated Chrome flags without dashes,
default is --headless
-h, --help Show help
-i, --input Input file, default is input.csv
-m, --metadata Optional column headings to be used as the first row of
_output.csv_, for example: Page, Type, Performance, SEO
-o, --output Output file, default is output.csv
-r, --runs Number of times audits are run to calculate median scores,
default is 3
-s, --score-method Method of score aggregation, default is median
- It's straightforward to log the complete Lighthouse report for each run. By default only aggregate audit scores are recorded. Look for the code in
index.js
marked***
. - The data from
output.csv
can easily be used to automatically update a spreadsheet and produce charts using an application such as Google Sheets. - See
TODO
for work in progress.
Please note that this is not an official Google product.