Skip to content

Access Website Carbon's API for checking carbon emissions for websites with Deno.

License

Notifications You must be signed in to change notification settings

timharek/wcarbon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest version sourcehut GitHub mirror

wcarbon

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

Usage

Example for site

import { site } from "jsr:@timharek/wcarbon";

const siteUrl = "example.org";
const result = await site(siteUrl);

Example for data

import { data } from "jsr:@timharek/wcarbon";

const result = await data({ bytes: 1024, hasGreenHosting: false });

CLI

Installation

deno install --allow-net=api.websitecarbon.com \
   -n wcarbon jsr:@timharek/wcarbon/cli

Usage

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

Development

  1. Install Deno
  2. Run deno task setup:hooks
  3. Now you can get to work! 😎

About

Access Website Carbon's API for checking carbon emissions for websites with Deno.

Topics

Resources

License

Stars

Watchers

Forks