wcarbon

Access Website Carbon’s API for checking carbon emissions for websites.

Usage

Example for site

import { querySite } from 'https://deno.land/x/wcarbon/mod.ts';

const domain = 'example.org';
const result = querySite(domain);

Example for data

import { queryData } from 'https://deno.land/x/wcarbon/mod.ts';

const bytes = '1024';
const result = queryData(bytes);

CLI

Installation

deno install --allow-net=api.websitecarbon.com \
   -n wcarbon https://deno.land/x/wcarbon/src/cli.ts

Usage

$ wcarbon timharek.no
$ wcarbon site timharek.no
$ wcarbon data 2048
$ wcarbon -h # for all available flags and commands

Development

  1. Install Deno
  2. Install githooked
  3. Run githooked enable
  4. Now you can get to work! 🕶️