Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lhci/utils

Package Overview
Dependencies
Maintainers
0
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lhci/utils

[![npm version](https://badge.fury.io/js/%40lhci%2Futils.svg)](https://badge.fury.io/js/%40lhci%2Futils)

  • 0.14.0
  • next
  • latest
  • v0.14.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
246K
increased by1%
Maintainers
0
Weekly downloads
 
Created

What is @lhci/utils?

@lhci/utils is a utility library for Lighthouse CI (LHCI), which is a tool for running Lighthouse audits on your codebase and tracking the results over time. This package provides various utilities to facilitate the use of LHCI, including configuration management, data handling, and result processing.

What are @lhci/utils's main functionalities?

Configuration Management

This feature allows you to load and parse the LHCI configuration file. The code sample demonstrates how to load the configuration using the `loadAndParseRcFile` function.

const { loadAndParseRcFile } = require('@lhci/utils');
const config = loadAndParseRcFile();
console.log(config);

Data Handling

This feature allows you to create a temporary Lighthouse Result (LHR) object. The code sample demonstrates how to create a temporary LHR using the `createTemporaryLhr` function.

const { createTemporaryLhr } = require('@lhci/utils');
const lhr = createTemporaryLhr({
  requestedUrl: 'https://example.com',
  finalUrl: 'https://example.com',
  audits: {},
  categories: {},
  configSettings: {},
  runWarnings: [],
  timing: {},
  i18n: {},
  environment: {},
});
console.log(lhr);

Result Processing

This feature allows you to process Lighthouse run results to find the median run. The code sample demonstrates how to use the `getMedianRun` function to find the median run from an array of Lighthouse run results.

const { getMedianRun } = require('@lhci/utils');
const runs = [/* array of Lighthouse run results */];
const medianRun = getMedianRun(runs);
console.log(medianRun);

Other packages similar to @lhci/utils

FAQs

Package last updated on 20 Jun 2024

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