https://github.com/timharek/wcarbon
Access Website Carbon's API for checking carbon emissions for websites with Deno.
https://github.com/timharek/wcarbon
cli-app co2-emissions co2-footprint deno deno-cli typescript website-carbon
Last synced: 3 months ago
JSON representation
Access Website Carbon's API for checking carbon emissions for websites with Deno.
- Host: GitHub
- URL: https://github.com/timharek/wcarbon
- Owner: timharek
- License: gpl-3.0
- Created: 2022-06-26T20:33:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-01T18:59:32.000Z (12 months ago)
- Last Synced: 2025-02-08T00:14:14.816Z (3 months ago)
- Topics: cli-app, co2-emissions, co2-footprint, deno, deno-cli, typescript, website-carbon
- Language: TypeScript
- Homepage:
- Size: 120 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
[](https://deno.land/x/wcarbon)
[](https://sr.ht/~timharek/wcarbon)
[](https://github.com/timharek/wcarbon)# wcarbon
Access [Website Carbon's API](https://api.websitecarbon.com/) for checking
carbon emissions for websites.## Usage
### Example for site
```ts
import { site } from "jsr:@timharek/wcarbon";const siteUrl = "example.org";
const result = await site(siteUrl);
```### Example for data
```ts
import { data } from "jsr:@timharek/wcarbon";const result = await data({ bytes: 1024, hasGreenHosting: false });
```## CLI
### Installation
```sh
deno install --allow-net=api.websitecarbon.com \
-n wcarbon jsr:@timharek/wcarbon/cli
```### Usage
```bash
$ wcarbon timharek.no
$ wcarbon site timharek.no
$ wcarbon data 2048
$ wcarbon -h # for all available flags and commands
```## Development
1. Install [Deno](https://deno.land)
1. Run `deno task setup:hooks`
1. Now you can get to work! :sunglasses: