npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lighthouse-plugin-green-it

v2.0.1

Published

plugin for lighthouse that uses Eco index's calculation methods to give a green it score

Downloads

81

Readme

Lighthouse Plugin - Green IT

This Lighthouse plugin utilizes EcoIndex's and The Green Web Foundation's methodologies to assess the eco-friendliness of webpages. The 'Green IT' score is determined based on a webpage's total weight, number of requests made, and DOM size.

lighthouse-plugin-green-it

Features

  • EcoIndex Calculations: Incorporates EcoIndex's well-regarded approaches to eco-friendliness assessment, providing a reliable metric of a webpage's environmental impact.
  • The Green Web Foundation's Techniques: Utilizes the proven methodologies from The Green Web Foundation, adding another layer of robustness to the evaluation.

Usage

  • install the package
npm i lighthouse-plugin-green-it
  • use it with the lighthouse CLI
lighthouse --plugins=lighthouse-plugin-green-it <URL>

or integrate it into your code like so:

const runnerResult = await lighthouse(url, {
      output: ['html', 'json'],
      port: chrome.port,
      plugins: ['lighthouse-plugin-green-it']
});

Credit

This project builds upon the foundational work done by EcoIndex and The Green Web Foundation.

  • EcoIndex: You can find their repositories here and the original calculations that have been integrated into this plugin.
  • The Green Web Foundation: Portions of their Lighthouse plugin have been reused in the development of this plugin.

Important modifications to Eco index

The EcoIndex scoring algorithm has been adjusted in this context to address perceived shortcomings in its original form. The initial approach appeared to disproportionately penalize scores based on the quantity of DOM elements. This adjustment is aimed at rectifying this perceived imbalance. A key requirement of this modification was to ensure that it had no impact on the calculations for CO2 emissions and water usage. As such, the modification involves a simple addition of 10 points to the score. This adjustment is justified with the case study of a webpage such as 'example.com'. Despite its efficient characteristics, such as a weight of 1kb, the presence of only 5 DOM elements, and a single request, the original EcoIndex scoring failed to award it the optimal score of 100. This modification seeks to address and correct such instances.