Get the Percentage of Unused JS on a page with Puppeteer

Tyler Clark
InstructorTyler Clark

Share this video with your friends

Send Tweet

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.

Kara Schaefer
Kara Schaefer
~ 3 years ago

Hi Tyler. Thanks a bunch for this video. I am not sure I am able to interpret the data in a meaningful way. For example I have a simple static site as my personal page right now (, and I don't even have any .js files, yet it still tells me that 45% of the JS is unused. Can you help me understand?