wcarbon
Access Website Carbon’s API for checking carbon emissions for websites.
Usage
Example for site
import { site } from "https://deno.land/x/wcarbon/mod.ts";
const siteUrl = "example.org";
const result = site(siteUrl);
Example for data
import { data } from "https://deno.land/x/wcarbon/mod.ts";
const result = data({ bytes: 1024, hasGreenHosting: false });
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
- Install Deno
- Run
deno task setup:hooks
- Now you can get to work! 🕶️