Skip to content

Lighthouse via npx

Lighthouse is Google’s open-source tool for auditing web pages on performance, accessibility, best practices, SEO, and PWA. With npx it runs without a global install — useful for one-off checks or CI.

Terminal window
npx lighthouse https://example.com --view

--view opens the HTML report in the default browser when the audit finishes.

Terminal window
# Mobile (default) vs desktop preset
npx lighthouse https://example.com --preset=desktop --view
# Limit audited categories
npx lighthouse https://example.com --only-categories=performance,seo --view
# JSON output for CI / scripting
npx lighthouse https://example.com --output=json --output-path=./report.json
# Both HTML and JSON
npx lighthouse https://example.com --output=html --output=json --output-path=./report
# Headless Chrome (no UI window)
npx lighthouse https://example.com --chrome-flags="--headless=new"
# Throttle off (use observed network/CPU)
npx lighthouse https://example.com --throttling-method=provided

For continuous monitoring use Lighthouse CI:

Terminal window
npx @lhci/cli@latest autorun

It collects multiple runs, asserts against budgets, and uploads reports to a server or temporary public storage.

  • SEO Tools — broader list of performance and SEO services