Compliance and sustainability JavaScript

green-site-auditMeasure the carbon footprint of a web page or online store

green-site-audit measures page weight and CO2 per visit with the Sustainable Web Design model v4, checks green hosting, and lists the oversized images, heavy JavaScript and third-party bloat to fix, with an embeddable badge.

npx npx green-site-audit https://your-store.com

Free · MIT license · runs on your machine · no signup npm ↗GitHub ↗

How green-site-audit works

Every page view moves data through data centres, networks and phones, and that takes energy. green-site-audit downloads your page the way a browser does, including fonts and images referenced from CSS, weighs every file and estimates CO2 per visit with the Sustainable Web Design model, using The Green Web Foundation’s open-source library. It also checks whether your host is verified green, looks for a carbon.txt file, shows how much a returning visitor downloads again based on your real cache settings, and can use the electricity grid of the country where your visitors are.

Then it tells you what to fix first: oversized product photos, images not in WebP or AVIF, heavy JavaScript, too many fonts, autoplay video, third-party scripts, missing compression and caching. It estimates how much lighter the page would be.

A lighter store is also a faster store, so the carbon and the conversion rate improve together. Add —badge to get an SVG badge for your footer.

Try it

npx green-site-audit https://your-store.com

Free and open source under the MIT license. Want this done for your store, or need help with the findings? Book a call.

Agent skill included

Let your AI coding agent run green-site-audit for you

The green-site-audit skill works with Claude Code, Codex, Cursor, Gemini CLI and other agents that read SKILL.md files. It runs the tool, explains each finding in plain words and helps you fix it.

npx skills add MuhammadAhmadZia/green-site-audit --skill green-site-audit

Using the Claude or ChatGPT apps instead? Download the skill ZIP from the GitHub releases page and upload it under Skills.

See all 30 agent skills →

Questions about green-site-audit

How accurate is the CO2 number?

It is a model estimate based on data transferred and global averages. Use it to compare versions of your own pages and find the biggest wins, not as an exact measurement.

Can I use it in CI?

Yes. --max-grams fails the run if a page goes above a limit you set.

My customers are in Pakistan. Does the world average apply?

Not necessarily. Add --country PAK and the tool uses Pakistan's electricity grid for visitors' phones and the network instead of the world average.

What is carbon.txt?

A small public file, like robots.txt, that lists your hosting provider and sustainability reports so tools can verify them. The audit tells you if your site has one.

UN Sustainable Development Goals

How each tool maps to SDG targets →

Want this set up and tuned for your store?

The tools are free. If you would rather have the checks run, the findings fixed and the results measured for you, that is what I do for clients.