thegreenwebfoundation / co2.js

An npm module for accessing the green web API, and estimating the carbon emissions from using digital services
Other
389 stars 49 forks source link

Test compatibility of CO2.js in with other js runtimes #115

Open mrchrisadams opened 1 year ago

mrchrisadams commented 1 year ago

One of the goals we had for CO2.js, and one of the reasons we invested a bunch of time in making it work as a hybrid library was to support a wide number of runtimes.

We currently support the nodejs runtime, and most modern browsers, but there are other runtimes that use javascript too.

Some examples below:

fershad commented 1 year ago

Re: Deno - They are planning to have more seamless NPM & Node interoperability in the next couple of months. https://deno.com/blog/changes#compatibility-with-node-and-npm

fershad commented 1 year ago

Untested yet, but we should be good in Deno as of 1.28

https://deno.com/blog/v1.28

fershad commented 1 year ago

This will be good to eventually have documented on the docs site, but we'll keep a rolling list here for now.

fershad commented 1 year ago

Here's a working demo in Deno: https://github.com/fershad/co2js-deno-demo

fershad commented 1 year ago

Here's a working demo in Bun https://github.com/fershad/co2js-bun-demo