Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
lighthouse-plugin-greenhouse
Advanced tools
A plugin for lighthouse to check for domains using green power
Lighthouse is a nice tool for helping you workout how to make a site more accessible, performance or mobile friendly.
But given climate change is a thing, what about making websites planet friendly too?
carbon.txt
Greenhouse is a lighthouse plugin, means you need lighthouse installed before you can use this plugin.
This readme assumes you have some familiarity with lighthouse, and know how to install it with npm or your preferred package manager:
npm install lighthouse
If you aren't, you can follow the instructions for installing lighthouse on the github project page for Lighthouse.
Lighthouse plugins need to follow a specific naming convention to be detected, and you currently can't use namespaces, so remember the name:
npm install lighthouse-plugin-greenhouse
Make sure you have Google lighthouse installed version 5 for above, and node 10 or above. You activate it by passing a --plugins
flag on the command line, like this example using npm's npx command, to use the local version of lighthouse:
npx lighthouse https://www.yoursite.com --plugins=lighthouse-plugin-greenhouse
You can also run this in a script if you want to automate running this, like as part of continuous integration process, to break the build when you're using infrastructure that relies on fossil fuels.
import { runLighthouse } from "lighthouse/lighthouse-cli/run"
const lhOptions = {
output: ["json"],
chromeFlags: "--headless --enable-logging --no-sandbox",
plugins: ["lighthouse-plugin-greenhouse"]
}
// we're using async/await syntax, as runLighthouse returns a Promise
async runCheck() {
const results = await runLighthouse("https://www.google.com", lhOptions)
// do something to inspect the result if need be
const score = res.lhr.categories["lighthouse-plugin-greenhouse"].score
}
runcheck()
See CONTRIBUTING for getting started, and either see the issues list, or if you have questions, please file one yourself.
You don't need to be a hard core developer to contribute to it, as help with copy, or the documentation, or a sample email to send to the people running services you want runnign on green power is just as valuable as actual code.
No, but given that page weight budgets are effectively carbon budgets for websites, it's worth using, and is a way in to thinking systemically about the environmental impact of the digital products we build. You can read more here in this post about the impact of sending data over the wire. There are other levers available your organisation too, from changes to infrastructure you control directly (aka Platform), or changes to where and how you work (process).
This plugin uses data from The Green Web Foundation, specifically the Green Web API. If you host infrastructure yourself, you can update the information yourself on the admin site.
If you use infrastructure run by someone else, it's important that you ask them as a customer or user - this is the number one reason cited for continuing to use infrastructure that runs on fossil fuels.
Yeah, it's scary AF.
You can work with the The Green Web Foundation to work out a plan for reducing emissions, by following this contact form, or come hang out in the Climate Action Tech Slack - there's a bunhc of us trying to figure it out, and you're welcome to join us.
Thanks goes to these wonderful people (emoji key):
Tobias Pfeiffer 🚇 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
A plugin for lighthouse to check for domains using green power
We found that lighthouse-plugin-greenhouse demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.