Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/wcarbon/mod.ts>data

Access Website Carbon's API for checking carbon emissions for websites with Deno.
Latest
function data
import { data } from "https://deno.land/x/wcarbon@v3.0.4/mod.ts";

Calculate the emissions of a page by manually passing the bytes and whether or not it is powered by green hosting.

Examples

Example for data

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

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

Parameters

unnamed 0: DataRequest

Takes in both bytes and hasGreenHosting args to calculate the emissions.

Returns

Promise<DataResponse | null>