Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@dreipol/lighthouse-config
Advanced tools
Centralized location to hold the @dreipol/lighthouse-runner
default configuration
npm i @dreipol/lighthouse-config
This module simply provides some default configuration. You can extend this config to your flavour. Therefore no setup for this module is required.
field | type | default | value |
---|---|---|---|
paths | Array | ['/'] | Array of url paths. All these routes are tested and reported |
chromeFlags | Array | ['--window-size=1200,800'] | Array of additional chrome flags. See all |
folder | string | ./dreihouse-reports | Define location to store the reports |
disableEmulation | boolean | true | Applay device emulation |
disableThrottling | boolean | true | Disable Network and CPU throttling |
preAuditScripts | Array | ['html'] | Current available persisters are html json and `html-dashboard |
report | Object | Lighthouse report configurations. See exmaples |
In order to handle login forms, or do other modifications of the page before lighthouse audits the page,
you can add some preAuditScripts
in the config. Those scripts are executed right before lighthouse starts.
These scripts have to implement the PreAuditScriptInterface
interface.
Before execution of this script, the browser instance will already be on the inital url, passed in the execute
method of Dreihouse
Here is an example of such login script
module.exports = {
execute:async(logger, page) {
await page.waitForSelector('#username', { visible: true });
await page.waitForSelector('#password', { visible: true });
const usernameInput = await page.$('#username');
const passwordInput = await page.$('#password');
await usernameInput.type(process.env.LOGIN_USERNAME);
await passwordInput.type(process.env.LOGIN_PASSWORD);
await passwordInput.press('Enter');
}
}
Now in your config
file you can load the login script
...
saveReport: true,
budget: {
...
},
preAuditScripts: [
require('your/login/script.js'),
],
reporters: {
modules: [
...
paths: [
'/',
],
folder: "./dreihouse-reports",
tag: 'desktop',
chromeFlags: ['--window-size=1280,1024'],
disableEmulation: true,
disableThrottling: true,
budget: {
dreipol: 100,
seo: 90,
performance: 90,
pwa: 70,
accessibility: 70,
'best-practices': 70,
},
report: {...}
You can extend the base configuration with your own configuration. This is done by creating a new config file in your project and include the base config via require. Then you can edit the Object the way you want
Example for local mobile config:
let mobileConfig = require('@dreipol/lighthouse-config/config/base/desktop');
mobileConfig.chromeFlags = ['--window-size=320,480'];
mobileConfig.disableEmulation = false;
mobileConfig.disableThrottling = false;
module.exports = mobileConfig;
FAQs
Basic lighthouse config
The npm package @dreipol/lighthouse-config receives a total of 1 weekly downloads. As such, @dreipol/lighthouse-config popularity was classified as not popular.
We found that @dreipol/lighthouse-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.