Closed dgrammatiko closed 4 years ago
Looks great! Any way we could make this opt-in, the data collection portion makes me nervous as a default:
By using this carbon calculator, you agree to the information that you submit being stored and published in our public database.
Any way we could make this opt-in, the data collection portion makes me nervous as a default
Yeah that's a good point, data collection might be a problem. https://github.com/zachleat/performance-leaderboard/pull/7/commits/0b34f5f9ac03bc047bb38d2438237f6fbd180772 should allow the conditional run of the audits.
By default it will skip the carbon auditing (you can simply flip the https://github.com/zachleat/performance-leaderboard/blob/0b34f5f9ac03bc047bb38d2438237f6fbd180772/performance-leaderboard.js#L15 to enable it by default or pass an option await PerfLeaderboard(urls, 3, {carbonAudit: true})
in the arguments
Excellent—thank you!
This is a better implementation of #6
It uses the www.websitecarbon.com API and adds one more dependency for Axios.
An example of the expected result is:
The carbon object in detail: