npx lighthouse https://example.com --output=json --output-path=./lh.json

Category: Web App Development

npx lighthouse https://example.com --output=json --output-path=./lh.json

Audit a page and save the report as JSON

Runs Lighthouse audits for performance, accessibility and best practices, writing the machine-readable JSON report to lh.json. The --output flag selects the format and --output-path names the file. Parse the JSON in CI to enforce score budgets.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.