Lighthouse Security

Runs the default Google Lighthouse tests with additional security tests.


Installation
npm install -g lighthouse-security
Run from CLI
Run the command from CLI like displayed below. The options are the same as for the default Lighthouse CLI options.
lighthouse-security <url> [options]
To run security audits only, use the --security
flag:
lighthouse-security <url> --security [options]
Use in code
The extension can also be used within your code. A short example is given below. To render reports etc. it is recommended to import functionality from Lighthouse.
const runLighthouse =
Alternatively you can import just the lighthouse-security
configuration and use it in your own runner:
const lighthouse = const chromeLauncher = // import one or more lighthouse configs:const securityConfig = // combine configs into one:const config = Object // run lighthouse as usual: { const chrome = await chromeLauncher flagsport = chromeport const results = await const stopped = await chrome return results}
Contributing
Contributions are always welcome. See CONTRIBUTING.md for guidelines and development scripts.