Releases: thegreenwebfoundation/co2.js
Release list
v0.19 - lookup domain for carbon.txt
Perform carbon.txt lookups with CO2.js
Recently, we made our carbon.txt API public allowing anyone to look up, parse and validate carbon.txt files in their own applications.
In this release of CO2.js, we introduce the ability for developers to lookup a web domain using our carbon.txt API. This allows developers to quickly check for the existence of a carbon.txt file on a given domain, and if one is found then returns the contents of that file in a JSON format. This mirrors the green hosting check functionality which has existed in CO2.js since 2019.
We're written a full tutorial on our developer docs site - Check a domain for carbon.txt.
What's Changed
Full Changelog: v0.18.0...v0.19.0
[PREVIEW] v0.19-alpha2
PREVIEW BUILD - Note this build my be buggy/unstable. It is for preview only, and should not be used in production projects.
This update adds the carbon.txt API validator endpoint to the CO2.js library. This allows for checks to be run against a web domain to check for the existence of a carbon.txt file, and then validate and parse the contents if a file is found.
Full Changelog: v0.18.1-0...v0.18.2-0
[PREVIEW] v0.19-alpha1
Full Changelog: v0.18.0...v0.18.1-0
v0.18.0
CO2.js v0.18 changes the default carbon estimation model to Sustainable Web Design Model (SWDM) version 4. It also see the addition of open, year grid intensity and fuel-mix data from from Electricity Maps.
What's Changed
Release notes: https://www.thegreenwebfoundation.org/news/release-guide-co2-js-v0-18/
Full Changelog: v0.17.0...v0.18.0
Accessing other Electricity Maps data
While we are able to provide annual grid data from Electricity Maps in CO2.js, users wishing to utilise data at higher-than-yearly resolution (e.g monthly, hourly etc.), or other historical and forecasted datapoints should contact Electricity Maps to access this data via their paid API. To do so, visit the Electricity Maps website for pricing and details.
Licenses
The annual grid intensity data is republished from Electricity Maps under the Open Database License (ODbL). Users of this data through CO2.js must:
- Attribute: Credit Electricity Maps as the source
- Share-Alike: Keep derivative works under the same license
- Keep open: Provide unrestricted versions if using DRM
For full details on Electricity Maps methodology see: https://www.electricitymaps.com/data/methodology
For full detail on the ODbL see: https://opendatacommons.org/licenses/odbl/summary/
[PREVIEW] v0.18-alpha2
This PREVIEW release allows users to experiment with new features and functions that are planned for release in CO2.js.
Changes for the upcoming v0.18 release which are available in this PREVIEW release include:
- changes the default carbon estimation model in CO2.js to Sustainable Web Design Version 4 (SWDMv4).
- add yearly grid data from Electricity Maps for all zones for the calendar years 2021-2025.
You can try this release in your code using the NPM command npm install tgwf/co2@next
Full Changelog: v0.17.0...v0.17.3-0
Changes
Default estimation model is now SWDMv4
By default, carbon estimation calculations in CO2.js will use the SWDMv4 model. Users wishing to use SWDMv3 or the OneByte model should explicitly reference those versions/models in their code.
import { co2 } from "@tgwf/co2";
// Use the default Sustainable Web Design Model v4
const swd = new co2();
// Use the OneByte model
const oneByte = new co2({ model: "1byte" });
// Use the Sustainable Web Design Model v3
const swdmV3 = new co2({ model: "swd", version: 3 });Electricity Map yearly data
Yearly data is available for all Electricity Maps zones for the calendar years 2021, 2022, 2023, 2024, and 2025. Data includes:
- Annual average grid carbon intensity
- Annual average grid renewable energy percentage
- Annual average grid carbon-free energy percentage
The code example below demonstrates how to get data for Australia for each calendar year.
import { yearly2025, yearly2024, yearly2023, yearly2022, yearly2021 } from '@tgwf/co2/data/electricity-maps';
const data2025 = yearly2025.data["AU"]
const data2024 = yearly2024.data["AU"]
const data2023 = yearly2023.data["AU"]
const data2022 = yearly2022.data["AU"]
const data2021 = yearly2021.data["AU"]
console.log({ data2025, data2024, data2023, data2022, data2021 })Licenses
Electricity Maps Grid Intensity Data - The annual grid intensity data is republished from Electricity Maps under the Open Database License (ODbL). Users of this data through CO2.js must:
- Attribute: Credit Electricity Maps as the source
- Share-Alike: Keep derivative works under the same license
- Keep open: Provide unrestricted versions if using DRM
For full details on Electricity Maps methodology see: https://www.electricitymaps.com/data/methodology
For full detail on the ODbL see: https://opendatacommons.org/licenses/odbl/summary/
Data at higher-than-yearly resolution (e.g monthly, hourly etc.), or other historical and forecasted datapoints are available through Electricity Maps as a paid service. Users requiring this data should visit the Electricity Maps website for pricing and details.
[PREVIEW] v0.18-alpha
This PREVIEW release changes the default carbon estimation model in CO2.js to Sustainable Web Design Version 4.
You can try this release in your code using the NPM command npm install tgwf/co2@next
What's Changed
Full Changelog: v0.17.0...v0.17.1-0
v0.17.0
Changes
- Add
dataandhostingsubpath exports by @fershad in #263 - Add warning about switching default model to SWDMv4 by @fershad in #269
Dependency updates
- Bump tar-fs from 2.1.3 to 2.1.4 by @dependabot[bot] in #265
- Bump js-yaml by @dependabot[bot] in #268
Full Changelog: v0.16.9...v0.17.0
v0.16.9
What's Changed
- [AUTOMATED] Update average annual grid intensities by @github-actions[bot] in #262
- Bump tar-fs from 2.1.1 to 2.1.3 by @dependabot[bot] in #259
Full Changelog: v0.16.8...v0.16.9
v0.16.8
What's Changed
- [AUTOMATED] Update average annual grid intensities by @github-actions in #258
- Fix: use
dataReloadRatioas multiplier instead of its complement in SWDM v4 by @alexzurbonsen in #257
Full Changelog: v0.16.7...v0.16.8
v0.16.7
What's Changed
- Bump esbuild from 0.14.54 to 0.25.0 by @dependabot in #251
- [AUTOMATED] Update average annual grid intensities by @github-actions in #253
- [AUTOMATED] Update average annual grid intensities by @github-actions in #256
Full Changelog: v0.16.6...v0.16.7