Coder Social home page Coder Social logo

krispy1298 / lighthouse-badges Goto Github PK

View Code? Open in Web Editor NEW

This project forked from emazzotta/lighthouse-badges

0.0 1.0 0.0 4.9 MB

🚦Generate badges (shields.io) based on Lighthouse performance.

License: MIT License

JavaScript 94.23% Dockerfile 5.77%

lighthouse-badges's Introduction

Build Status Code Coverage NPM downloads NPM version License

Lighthouse Badges

Lighthouse

This package allows you to easily create Lighthouse badges for all Lighthouse categories.
Ever wanted to brag about your sites's awesome Lighthouse performance? Then this is the package for you!

Examples

All Badges

Lighthouse Accessibility Badge Lighthouse Best Practices Badge Lighthouse Performance Badge Lighthouse PWA Badge Lighthouse SEO Badge

Single Badge

Lighthouse

Usage

Help

usage: lighthouse-badges [-h] [-v] [-s]
                         [-b {flat,flat-square,plastic,for-the-badge,popout,popout-square,social}]
                         [-o OUTPUT_PATH] [-r] -u URLS [URLS ...]


Generate gh-badges (shields.io) based on lighthouse performance.

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -s, --single-badge    Output only one single badge averaging all lighthouse
                        categories' scores
  -b {flat,flat-square,plastic,for-the-badge,popout,popout-square,social}, --badge-style {flat,flat-square,plastic,for-the-badge,popout,popout-square,social}
                        Define look and feel for the badge
  -o OUTPUT_PATH, --output-path OUTPUT_PATH
                        Define output path for artifacts
  -r, --save-report     Save lighthouse report as html for every supplied url

Required arguments:
  -u URLS [URLS ...], --urls URLS [URLS ...]
                        The lighthouse badge(s) will contain the respective
                        average score(s) of all the urls supplied, combined

Additionally you can pass parameters to the lighthouse process directly via environment variable:

# This will pass '--preset=desktop' to the lighthouse process
export LIGHTHOUSE_BADGES_PARAMS="--preset=desktop"
lighthouse-badges --urls https://www.youtube.com/

Run

Hint: Only node >= 12 is supported.

Option 1: npm

npm i -g lighthouse-badges
lighthouse-badges --urls https://www.youtube.com/ https://www.youtube.com/feed/trending -o test_results

Option 2: npx

npx lighthouse-badges --urls https://www.youtube.com/ https://www.youtube.com/feed/trending -o test_results

Option 3: Docker

# Warning, the docker version may alter the lighthouse results
docker run --rm \
    -v $PWD/test_results:/home/chrome/reports \
    emazzotta/lighthouse-badges \
    /bin/sh -c "lighthouse-badges --urls https://www.youtube.com/ https://www.youtube.com/feed/trending"

Contributing

See contribution guideline

Sponsors

Sponsored by JetBrains

Jetbrains Logo

Author

Emanuele Mazzotta

lighthouse-badges's People

Contributors

emazzotta avatar dependabot[bot] avatar dependabot-preview[bot] avatar greenkeeper[bot] avatar codacy-badger avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.