Skip to content

Instantly share code, notes, and snippets.

@nathanieltubb
Created May 23, 2019 01:37
Show Gist options
  • Save nathanieltubb/05817e060d6d02a16407c8cc66f52235 to your computer and use it in GitHub Desktop.
Save nathanieltubb/05817e060d6d02a16407c8cc66f52235 to your computer and use it in GitHub Desktop.
Lighthouse CLI Audits

Requires:

  • Node JS

Node Modules:

Examples:

Basic Full Audit w. Default HTML Output, Throttling, Device and Open Report In Browser

lighthouse <url> --view

Basic Full Audit w. JSON Output to stdout

lighthouse <url> --output=json --quiet

Basic JSON and HTML

lighthouse <url> --output=json --output=html --output-path=./lighhouse-report/ --emulated-form-factor=desktop --throttling-method=devtools --quiet --chrome-flags="--headless"

Batch Mobile JSON and HTML

Not sure if --no-sandbox flag is causing Mac OS keychain prompt. Might need to just run this without that flag. lighthouse-batch -g -s <url>,<url> --html --params="--chrome-flags=\"--no-sandbox --headless --disable-gpu\" --emulated-form-factor=mobile --throttling-method=devtools --quiet" --out="./lighthouse-mobile-`date +%F-%H-%M-%S`/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment