import { data } from "https://deno.land/x/wcarbon@v3.0.4/src/wcarbon.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
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>