Skip to content

Commit

Permalink
add guidance on installing type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
fershad committed Jan 8, 2024
1 parent ff6f767 commit b5d8828
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# CO2.js

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->

[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)

<!-- ALL-CONTRIBUTORS-BADGE:END -->

<img src="https://github.com/thegreenwebfoundation/co2.js/actions/workflows/unittests.yml/badge.svg" />
Expand Down Expand Up @@ -75,6 +77,14 @@ You can also build the CO2.js library from the source code. To do this:
- `dist/esm` - An ES Modules compatible build.
- `dist/iife` - An Immediately Invoked Function Expression (IIFE) version of the library.

## Using CO2.js in TypeScript projects

Type definitions for CO2.js are published in the DefinitelyTyped project, and are available on NPM at `@types/tgwf__co2`.

If you want to use type definitions in your project, they should be installed as a devDependency.

`npm install --dev @types/tgwf__co2`

## Marginal and average emissions intensity data

CO2.js includes yearly average grid intensity data from [Ember](https://ember-climate.org/data/data-explorer/), as well as marginal intensity data from the [UNFCCC](https://unfccc.int/) (United Nations Framework Convention on Climate Change). You can find the data in JSON and CommonJS Module format in the `data/output` folder.
Expand Down

0 comments on commit b5d8828

Please sign in to comment.