Skip to content

Release Guide: CO2.js v0.17

CO2.js v0.17 release image from GitHub

CO2.js v0.17 adds subpath exports to the library, providing a more consistent experience for ESM and CJS users. The update also includes information for developers about future planned changes to the default carbon estimation model.

Subpath Exports

Adding subpath exports to CO2.js gives us more flexibility in the future to add new datasets and functionality. In v0.17 we introduce subpath exports for the data and hosting APIs in the library.

// Import data from CO2.js
import { averageIntensity } from "@tgwf/co2/data"
import { marginalIntensity } from "@tgwf/co2/data"

// Check for green web hosting using CO2.js
import { check } from "@tgwf/co2/hosting"

They also make code implementation more consistent when using CO2.js in ESM and CommonJS projects. This is something that was raised in a recent issue, and we hope this change will improves that developer experience in a small way.

// Both these statements work
const { check } = require("@tgwf/co2/hosting");
import { check } from "@tgwf/co2/hosting";

Adding subpath exports for estimation models

Adding subpath exports for estimation models in CO2.js might require a bit more effort to ensure changes made do not break existing projects using CO2.js that do not wish to adopt subpath exports. We will look into how this can be achieved, and are tracking that work under an open GitHub issue with the aim to add it in a future release.

Preparing to Switch the default estimation model to Sustainable Web Design Model version 4

In CO2.js v0.16 we introduced the Sustainable Web Design Model version 4 (SWDMv4) into the library, alongside the previous version 3 (SWDMv3) of the model. This was in 2024, and at the time, we chose to keep SWDMv3 as the default carbon estimation model in the library, while requiring users to explicitly opt-in to SWDMv4.

Since then we have seen many of the most popular website estimation tools switching over to using SWDMv4. As such, we feel the time is right for us to also update CO2.js to use SWDMv4 as the default carbon estimation model. This change will take place in v0.18 (expected to release in February 2026).

In v0.17, we have added a console warning for developers who are using the default carbon estimation model in their code. In the weeks to come, we will release a preview version of CO2.js for early adopters to install and test, as well as make more broader public communication and documentation about the upcoming change.

We’ve explained more about the difference between the two version of the Sustainable Web Design Model in Understanding the latest Sustainable Web Design Model update. To stay up-to-date with releases and CO2.js news, you can also subscribe to our mailing list.


You can find details of every release for CO2.js on GitHub, where you’ll also be able find the changelog for this project.


Get notified about CO2.js news