# lighthouse-compare

> **Note: This is the pre-alpha version. Please contact [me](mailto:yuhaoju0623@gmail.com) to get the API token if you want to use and help improve this service :slightly_smiling_face:.**

Latest version **0.3.1** (published 2018-12-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install lighthouse-compare
pnpm add lighthouse-compare
yarn add lighthouse-compare
bun add lighthouse-compare
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.1 |
| Published | 2018-12-27 |
| First published | 2018-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 53.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Yuhao Ju |
| Maintainers | yuhaoju |

## Links

- npm: https://www.npmjs.com/package/lighthouse-compare
- Repository: https://github.com/yuhaoju/lighthouse-compare
- Homepage: https://github.com/yuhaoju/lighthouse-compare#readme
- Issues: https://github.com/yuhaoju/lighthouse-compare/issues
- npm.io page: https://npm.io/package/lighthouse-compare

## Dependencies (1)

- [superagent](https://npm.io/package/superagent.md) ^4.0.0

## Recent versions

- 0.3.1 (latest) — 2018-12-27
- 0.3.0 — 2018-12-27
- 0.2.1 — 2018-12-20
- 0.2.0 — 2018-12-20
- 0.1.0 — 2018-12-20

## README

# lighthouse-compare

**Note: This is the pre-alpha version. Please contact [me](mailto:yuhaoju0623@gmail.com) to get the API token if you want to use and help improve this service :slightly_smiling_face:.**

## Feature

### What is Lighthouse?
[Lighthouse](https://developers.google.com/web/tools/lighthouse/) is a tool built and open sourced by Google, which is to improve the quality of web apps.

### Lighthouse Compare?
The goal of Ligthouse Compare is to monitor and keep web app’s quality by running Lighthouse in CI and compare reports so that developers can see how a particular changeset influenced the score or any of the audits.

## Installation
```
$ npm install lighthouse-compare lighthouse --save
```

## Usage
1. Use lighthouse-compare in your test script
```JavaScript
// test.js
const cp = require('child_process');
const compare = require('lighthouse-compare');

// build and start to serve locally
cp.execSync('yarn build', { stdio: 'inherit' });
const proc = cp.spawn('yarn', ['serve']);

// run lighthouse analysing
compare.run({ url: 'http://localhost:5001' });
```

2. Run script in CI
A `.travis.yml` example:
```
# need following config for running chrome
sudo: required
dist: trusty

# other config

# run your test script
script: node ./test.js

# add chrome addon to run lighthouse
addons:
  chrome: stable
```

3. You should be able to see the report link in the CI logs.
![image](https://user-images.githubusercontent.com/4938243/50292010-03222980-04ab-11e9-9bc4-7c0228101a74.png)

4. Click into the link and you can see the report ([example](https://lighthouse-compare-service.herokuapp.com/app/yuhaoju/lc-test-app/report/166470060)).
![image](https://user-images.githubusercontent.com/4938243/50293506-bb9d9c80-04ae-11e9-9d0b-7d762eae94f8.png)

## TODO

- Wrap the service with Github App
- Comment in Pull Request (score and audits diff)
- Cli tool

---
_Source: https://npm.io/package/lighthouse-compare · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
