Skip to content

Conversation

@dotjay
Copy link

@dotjay dotjay commented Nov 14, 2025

Triage

Type of change

Please select any of the below items that are appropriate.

This pull request:

  • Adds a new carbon estimation model to CO2.js
  • Adds new functionality to an existing model
  • Fixes a bug with an existing model implementation
  • Add other new functionality to CO2.js
  • Add new data to CO2.js
  • Improves developer experience for contributors
  • Adds contributors to CO2.js
  • Does something not specified above

Related issue/s

Docs changes required

Do any changes made in this pull request require parts of the CO2.js documentation to be updated?

  • Yes
  • No
  • I don't know

Describe the changes made in this pull request

Make check() a public method for the ESM version by wrapping the exported method in an object, making more consistent with the CJS version.

@fershad
Copy link
Contributor

fershad commented Nov 27, 2025

Thanks @dotjay

When I test out this code on the following, it throws an error (TypeError: hosting is not a function):

const { hosting } = require("@tgwf/co2");

const options = {
  verbose: false,
  userAgentIdentifier: "myGreenApp",
};
hosting("google.com", options).then((result) => {
  console.log(result);
});

I'm wondering if something is happening in the build step that messes with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants