0.1.2 • Published 5 years ago

@codechecks/lighthouse-keeper v0.1.2

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

Install

npm install --save-dev @codechecks/lighthouse-keeper

Usage

Are you new to codechecks? Check out getting started guide (it's simple)!

Add to your codechecks.yml file:

checks:
  - name: lighthouse-keeper
    options:
      # just provide path to your build
      buildPath: ./build
      # or full url
      # url: https://google.com
      # you can specify minScores and automatically fail builds
      minScores:
        performance: 90
  # ...

API

lighthouseKeeper(options: Options): Promise\

options

interface Options {
  url?: string;
  buildPath?: string;
  minScores?: Dictionary<number>;
}
url

optional string Provide URL that lighthouse will be ran against. url OR buildPath MUST be provided.

buildPath

optional string Provide relative path to directory with build. It will be served using http-server package and lighthouse will be ran against it. url OR buildPath MUST be provided.

minScore

optional Dictionary of numbers Provide minimal scores for each metric. Possible keys are:

  • performance
  • accessibility
  • best-practices
  • seo
  • pwa

Contributing

All contributions are welcomed. Read more in CONTRIBUTING.md

Licence

MIT @ codechecks.io

Acknowledges

Thanks go to @andreasonny83 for his support and creating the lighthouse-ci