Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dvelasquez/carbon-tools
A set of CO2 footprint tools to measure the impact of the code we ship
https://github.com/dvelasquez/carbon-tools
Last synced: 3 months ago
JSON representation
A set of CO2 footprint tools to measure the impact of the code we ship
- Host: GitHub
- URL: https://github.com/dvelasquez/carbon-tools
- Owner: dvelasquez
- License: mit
- Created: 2020-10-11T08:39:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T14:22:55.000Z (7 months ago)
- Last Synced: 2024-04-14T12:03:38.092Z (7 months ago)
- Language: TypeScript
- Size: 3.83 MB
- Stars: 15
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- open-sustainable-technology - Carbon Tools - A set of CO2 footprint tools to measure the impact of the code we ship. (Consumption / Computation and Communication)
README
# Carbon Tools
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)This is a [mono-repository/multi-package](https://dev.to/tallyb/six-blind-people-and-a-monorepo-1n49) built with Lerna & TypeScript.
## Contents
1. [bytes-to-co2:](./packages/bytes-to-co2) A library that estimates the CO2 released to the atmosphere based on the transferred byte size.
2. [co2-extension](./packages/co2-extension): A Chrome (for now) that shows the amount of CO2 released by visiting the current page.
3. [lighthouse-plugin-co2](./packages/lighthouse-plugin-co2): A Lighthouse Plugin that calculates the CO2 of all the data transferred by a page.
4. [co2-data](./packages/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](https://www.npmjs.com/package/co2-data) and
[bytes-to-co2](https://www.npmjs.com/package/bytes-to-co2), which you can install in your project using:- `yarn add bytes-to-co2` or `npm i bytes-to-co2`
- `yarn add co2-data` or `npm i co2-data`## Development - Getting started
Project supports NodeJS >= v12.x
1. Clone the project `git clone https://github.com/dvelasquez/carbon-tools.git`
2. Run `yarn` to install the dev dependencies
3. Use `pnpm lerna:build` to build all the libraries
4. Use `pnpm lint` to lint files and catch issues with the code styling, or possible code errors
5. Use `pnpm test` to run Node TAP tests