Socket
Book a DemoInstallSign in
Socket

lighthouse-keeper

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lighthouse-keeper

collecting multiple web-site performances by using lighthouse

0.4.5
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

lighthouse-keeper

npm CircleCI codecov codebeat badge Greenkeeper badge

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 = require("lighthouse-keeper");
const config = require("./path/to/config");

lhk.exec(config)
  .then((context) => {
    console.log(context.getResults());
  })
  .catch((err) => {
    console.error(err);
  });

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

url
https://google.com
const {readCsvTargetList} = require("lighthouse-keeper").config;

module.exports = {
  targets: readCsvTargetList("/path/to/*.csv"),
  ...
}

reporters [required]

Array of Reporter instance.

use built-in reporters

There are two built-in reporters; JsonReporter and CsvReporter.

const {JsonReporter,CsvReporter} = require("lighthouse-keeper").reporter;

module.exports = {
  targets: [{ url: "https://google.com" }...],
  reporters: [
    new JsonReporter("path/to/output.json"),
    new CsvReporter("path/to/output.csv")
  ],
  ...
}

use custom reporters

const {Reporter} = require("lighthouse-keeper").reporter;

class MyReporter extends Reporter{
  constructor(){
    super();
  }
  open(){...}
  write(){...}
  close(){...}
}
const MyReporter = require("path/to/my-reporter");

{
  targets: [{ url: "https://google.com" }...],
  reporters: [
    new MyReporter()
  ],
  ...
}

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'],
  }
}

FAQs

Package last updated on 07 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.