# Lighthouse CI

[![npm version](https://badge.fury.io/js/lighthouse-ci-custom-flags.svg)](https://badge.fury.io/js/lighthouse-ci-custom-flags)
[![npm](https://img.shields.io/npm/dt/lighthouse-ci.svg)](https://www.npmjs.com/package/lighthouse-ci-custom-flags)
[![Known Vulnerabilities](https://snyk.io/test/github/andreasonny83/lighthouse-ci/badge.svg?targetFile=package.json)](https://snyk.io/test/github/andreasonny83/lighthouse-ci?targetFile=package.json)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)

> A useful wrapper around Google Lighthouse CLI

<img alt="Lighthouse CI logo" src="logo.png" width="800px">

<img src="lighthouse-cli.gif" width="700">

## Install

```
$ npm install -g lighthouse-ci-custom-flags
```

## Usage

```sh
lighthouse-ci --help
```

## CLI

```
$ lighthouse-ci --help

  Usage
    $ lighthouse-ci <target-url>

  Example
    $ lighthouse-ci https://example.com/
    $ lighthouse-ci -s https://example.com/
    $ lighthouse-ci https://example.com/ --score=75
    $ lighthouse-ci https://example.com/ --accessibility=90 --seo=80

  Options
    -r, --report                  Generate an HTML report inside a 'lighthouse' folder.
    -s, --silent                  Run Lighthouse without printing report log.
    --score=<threshold>           Specify a score threshold for the CI to pass.
    --performance=<threshold>     Specify a minimal performance score for the CI to pass.
    --pwa=<threshold>             Specify a minimal pwa score for the CI to pass.
    --accessibility=<threshold>   Specify a minimal accessibility score for the CI to pass.
    --best-practice=<threshold>   Specify a minimal best-practice score for the CI to pass.
    --seo=<threshold>             Specify a minimal seo score for the CI to pass.
  
  Original Lighthouse flags
    --disable-device-emulation    Disable Nexus 5X emulation
    --throttling-method=<method>  Controls throttling method         [choices: "devtools", "provided", "simulate"]
```
For list of supported flags, see [Lighthouse cli options](https://github.com/GoogleChrome/lighthouse#cli-options)

## License

MIT

---

Created with 🦄 by [andreasonny83](https://about.me/andreasonny83)
