Sign inSign up

emazzotta/lighthouse-badges

By emazzotta

Updated 3 days ago

A simple npm package to generate gh-badges (shields.io) based on lighthouse performance.

Image
1

10K+

emazzotta/lighthouse-badges repository overview

Build Status Code Coverage Dependencies Downloads Today NPM version Docker Commit 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}] [-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}, --badge-style {flat,flat-square,plastic}
                        Define look and feel for the badge
  -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

Run
# Using npm
npm i -g lighthouse-badges
# The badges will be saved in your current directory
lighthouse-badges --urls https://www.youtube.com/ https://www.youtube.com/feed/trending

# Using Docker
docker pull emazzotta/lighthouse-badges
# Replace $(pwd) with the report/svg save path on your host 
docker run -v $(pwd):/home/chrome/reports emazzotta/lighthouse-badges /bin/sh -c "lighthouse-badges --urls https://www.youtube.com/ https://www.youtube.com/feed/trending"

Author

Emanuele Mazzotta

Tag summary

Content type

Image

Digest

sha256:a7ccbf978

Size

360.2 MB

Last updated

3 days ago

docker pull emazzotta/lighthouse-badges