Get the Percentage of Unused JS on a page with Puppeteer
lessonDuration 2m 7sFree
It can be helpful when automating tests, metrics, and integration tools to know not only how much JavaScript there is on a page but to calculate how much is not being used. We are able to calculate the percentage of JS used by getting metrics from the window object.