Emissions
Installation
npm install @danhartley/emissions
Use
In a node environment e.g. to run an e2e test.
In the browser.
Node
Simple Puppeteer example
The example takes a URL as an argument on the command line and returns an emissions report. A lighthouse report is optional.
Production code
See E2E test for single page emissions
See E2E test that tracks emissions across actions
Browser
See Vanilla JS helper function
See React component in TypeScript