Use Lighthouse as a Node module to programmatically to audit, record and compare web performance metrics.
This will generate the lighthouse JSON report for specified URL and store it in reports directory. The generated report can be viewed using https://googlechrome.github.io/lighthouse/viewer2x/.
- Node.js: v10 or above
git clone https://github.com/subhra44/lighthouse-nodejs.git
npm install
node lh.js --url http://subhra.me/
node lh.js --from reports/subhra.me/2020-04-29T17_35_22.373Z --to reports/subhra.me/2020-05-01T17_09_11.665Z
- Go to https://googlechrome.github.io/lighthouse/viewer/
- Upload the generated JSON file
Script is written based on the below article.
https://github.com/GoogleChrome/lighthouse/blob/master/docs/readme.md#using-programmatically
https://css-tricks.com/build-a-node-js-tool-to-record-and-compare-google-lighthouse-reports/