lighthouse-badges

by emazzotta

šŸš¦Generate badges (shields.io) based on Lighthouse performance.

139 Stars 18 Forks Last release: Not found MIT License 607 Commits 25 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Codacy Badge Build Status Code Coverage Dependencies 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 '--emulated-form-factor=desktop' to the lighthouse process
export LIGHTHOUSE_BADGES_PARAMS="--emulated-form-factor=desktop"
lighthouse-badges --urls https://www.youtube.com/

Run

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

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

Author

Emanuele Mazzotta

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.