Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

co2-data

Package Overview
Dependencies
Maintainers
0
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co2-data

Carbon intensity of 66 countries and a world average updated to 2020

  • 0.0.63
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
46
decreased by-84.03%
Maintainers
0
Weekly downloads
 
Created
Source

co2-data

Small library that extracts the average carbon intensity from json requests from the Electricity Map API.

This project reads the api responses and consolidates the results in a single lightweight file that is exported.

24kb / 5kb gzip

Getting started

  • Install the library using npm install co2-data or yarn add co2-data
  • Import the function you want to use:
import { 
    co2Data,      // Raw javascript array with the country iso code and the average carbon intensity 
    getFactor,    // Function to get the average carbon intensity by country code
    getCountries  // List of country codes and sub-codes
} from 'co2-data';

getFactor(co2Data, 'CL'); // Average for Chile: 343.27340406847736
getCountries(); // Array with the ISO code and the name of the countries [{code: 'CL', 'Chile'},...]

Credits

Keywords

FAQs

Package last updated on 01 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc