lighthouse-keeper
A wrapper tool of lighthouse to collect multiple web-site performance data.
use from cli
$ npm i -g lighthouse-keeper
$ lhk --config [path to config]
use from program
$ npm i lighthouse-keeper
const lhk = ;const config = ; lhk ;
configuration
targets: url: "https://google.com" ... reporters: Reporter... chromeNum: 2 puppeteerConfig: puppeteerConfig lighthouseConfig: lighthouseConfig
targets [required]
Array of target to perform audits by lighthouse.
The target object must contains url
property as follows:
url: "https://google.com"
use csv target list
urlhttps://google.com
const readCsvTargetList = config; moduleexports = targets: ...
reporters [required]
Array of Reporter instance.
use built-in reporters
There are two built-in reporters; JsonReporter
and CsvReporter
.
const JsonReporterCsvReporter = reporter; moduleexports = targets: url: "https://google.com" ... reporters: "path/to/output.json" "path/to/output.csv" ...
use custom reporters
const Reporter = reporter; { super; } {...} {...} {...}
const MyReporter = ; targets: url: "https://google.com" ... reporters: ...
chromeNum [option]
Number of chromes to launch for running lighthouse.
This parameter is optional. Default value is 1
;
puppeteerConfig [option]
Object of options to launch chrome via puppeteer. See launch config of puppeteer
This parameter is optional. Default value is follows:
headless: true
lighthouseConfig [option]
Object of options to run lighthouse. See config of LightHouse
This parameter is optional. Default value is follows:
extends: 'lighthouse:default' settings: onlyCategories: 'performance'