New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@dreipol/lighthouse-audits

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dreipol/lighthouse-audits

Collection of default audits from dreipol

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
4
Weekly downloads
 
Created
Source

@dreipol/lighthouse-audits

CircleCI

Collection of useful lighthouse audits

Install

npm i @dreipol/lighthouse-audits --save

Setup

This module provides some audits for deeper inspections and better quality of your website/project.

Config

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

Usage

API

Structure of exported module. You can use these to add them as audits/gatherers

Plain Email Addresses

ClassDescriptionAudit Name
PlainEmail.PlainEmailGathererGahters email adresses from a webpage
PlainEmail.PlainEmailAuditCalculates the score for emails found on the pageplain-email-audit
ClassDescriptionAudit Name
BrokenLink.BrokenLinkGathererGathers all links from a page
BrokenLink.BrokenLinkAuditCheck if any link resolves to a 404 pagebrokenlink-audit

Page Meta Tags

ClassDescriptionAudit Name
Meta.MetaGathererGather all META tags with the name='robots' on a page
Meta.MetaAuditCheck if any tag has a no-index or no-follow valuemeta-audit

Page Speed Insights

ClassDescriptionAudit Name
PSI.PSIGathererRuns a PSI report for the page
PSI.PSISpeedScoreAuditCalculate score based on the speed scorepsi-speed-score
PSI.PSIUsabilityScoreAuditCalculate score based on the usability scorepsi-usability-score
PSI.PSIHTMLSizeAuditCalculate score based on the HTML sizepsi-html
PSI.PSICssSizeAuditCalculate score based on the CSS sizepsi-css
PSI.PSIImgSizeAuditCalculate score based on the IMG sizepsi-img
PSI.PSIJsSizeAuditCalculate score based on the JS sizepsi-js
PSI.PSIJsResourcesAuditCalculate score based on the amount of JS resourcespsi-js-resources
PSI.PSICssResourcesAuditCalculate score based on the amount of CSS resourcespsi-CSS-resources

Example usage see above

Test

To test the config in the /example folder run

dreihouse report https://dreipol.ch -f ./example/lh.desktop.js -vvv

FAQs

Package last updated on 01 Jun 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc