Carbon Tools
This is a mono-repository/multi-package built with Lerna & TypeScript.
Contents
- bytes-to-co2: A library that estimates the CO2 released to the atmosphere based on the transferred byte size.
- co2-extension: A Chrome (for now) that shows the amount of CO2 released by visiting the current page.
- lighthouse-plugin-co2: A Lighthouse Plugin that calculates the CO2 of all the data transferred by a page.
- co2-data: A small library with information of carbon intensities by country.
Using as a dependency
For now, we are only exposing as libraries co2-data and bytes-to-co2, which you can install in your project using:
yarn add bytes-to-co2ornpm i bytes-to-co2yarn add co2-dataornpm i co2-data
Development - Getting started
Project supports NodeJS >= v20.x
- Clone the project
git clone https://github.com/dvelasquez/carbon-tools.git - Run
pnpm ito install the dev dependencies - Use
pnpm lerna:buildto build all the libraries - Use
pnpm lintto lint files and catch issues with the code styling, or possible code errors - Use
pnpm testto run Node TAP tests