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-audits
Advanced tools
Collection of useful lighthouse audits
npm i @dreipol/lighthouse-audits --save
This module provides some audits for deeper inspections and better quality of your website/project.
To add an audit to your lighthouse configuration you simply import this module. This module exports a couple of object (See API below). Those modules contain audits and gatherers. Those can be simply be added to your already existent lighthouse configuration.
Example
const {
PSI,
} = require('@dreipol/lighthouse-audits');
...
passes: [
{
passName: 'defaultPass',
recordTrace: true,
pauseAfterLoadMs: 10000,
networkQuietThresholdMs: 10000,
cpuQuietThresholdMs: 10000,
gatherers: [
PSI.PSIGatherer,
'url',
'scripts',
'css-usage',
'viewport',
'viewport-dimensions',
...
...
audits: [
PSI.PSISpeedScoreAudit,
'service-worker',
'viewport',
'without-javascript',
Now we've added the gatherer
and the audit
. But if we run the audits now, we wont see the result of the audit in the
report, since we didn't added the category where the audit should be added at. There are two options.
First is to add all the categories and assign the audits by your own (recommended when not using the default)
categories: {
dreipol: {
name: 'Dreipol Audits',
description: 'Dreipol audits',
audits: [
{ id: '<AUDIT_NAME>', weight: 5 },
],
},
psi: {
name: 'PSI',
description: 'Page Speed Insight audits',
audits: [
{ id: 'psi-speed-score', weight: 5 },
...
],
}
Or you can use the default categories exported by this module. Those default categories are available under Categories
Exmaple in your lighthouse config:
const {
Categories,
} = require('@dreipol/lighthouse-audits');
...
categories: {
psi: Categories.PSI,
dreipol: Categories.Dreipol,
}
Structure of exported module. You can use these to add them as audits/gatherers
Class | Description | Audit Name |
---|---|---|
PlainEmail.PlainEmailGatherer | Gahters email adresses from a webpage | |
PlainEmail.PlainEmailAudit | Calculates the score for emails found on the page | plain-email-audit |
Class | Description | Audit Name |
---|---|---|
BrokenLink.BrokenLinkGatherer | Gathers all links from a page | |
BrokenLink.BrokenLinkAudit | Check if any link resolves to a 404 page | brokenlink-audit |
Class | Description | Audit Name |
---|---|---|
Meta.MetaGatherer | Gather all META tags with the name='robots' on a page | |
Meta.MetaAudit | Check if any tag has a no-index or no-follow value | meta-audit |
Class | Description | Audit Name |
---|---|---|
PSI.PSIGatherer | Runs a PSI report for the page | |
PSI.PSISpeedScoreAudit | Calculate score based on the speed score | psi-speed-score |
PSI.PSIUsabilityScoreAudit | Calculate score based on the usability score | psi-usability-score |
PSI.PSIHTMLSizeAudit | Calculate score based on the HTML size | psi-html |
PSI.PSICssSizeAudit | Calculate score based on the CSS size | psi-css |
PSI.PSIImgSizeAudit | Calculate score based on the IMG size | psi-img |
PSI.PSIJsSizeAudit | Calculate score based on the JS size | psi-js |
PSI.PSIJsResourcesAudit | Calculate score based on the amount of JS resources | psi-js-resources |
PSI.PSICssResourcesAudit | Calculate score based on the amount of CSS resources | psi-CSS-resources |
Example usage
see above
To test the config in the /example
folder run
dreihouse report https://dreipol.ch -f ./example/lh.desktop.js -vvv
FAQs
Collection of default audits from dreipol
The npm package @dreipol/lighthouse-audits receives a total of 1 weekly downloads. As such, @dreipol/lighthouse-audits popularity was classified as not popular.
We found that @dreipol/lighthouse-audits 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.