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

  • 0.6.0
  • npm
  • Socket score

Version published
Maintainers
4
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

  • Categories
    • PSI
    • Dreipol
  • PlainEmail
    • PlainEmailGatherer
    • PlainEmailAudit {name: 'plain-email-audit'}
  • BrokenLink
    • BrokenLinkGatherer
    • BrokenLinkAudit {name: 'brokenlink-audit'}
  • PSI
    • PSIGatherer
    • PSISpeedScoreAudit {name: 'psi-speed-score'}
    • PSIUsabilityScoreAudit {name: 'psi-usability-score'}
    • PSIHTMLSizeAudit {name: 'psi-html'}
    • PSICssSizeAudit {name: 'psi-css'}
    • PSIImgSizeAudit {name: 'psi-img'}
    • PSIJsSizeAudit {name: 'psi-js'}
    • PSIJsResourcesAudit {name: 'psi-js-resources'}
    • PSICssResourcesAudit {name: 'psi-css-resources'}

FAQs

Package last updated on 14 May 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