
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@lhci/utils
Advanced tools
[](https://badge.fury.io/js/%40lhci%2Futils)
@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.
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);
Lighthouse is an open-source, automated tool for improving the quality of web pages. It can be run as a Node module or from the command line. While @lhci/utils provides utilities specifically for Lighthouse CI, the lighthouse package itself is used for running Lighthouse audits and generating reports.
Lighthouse CI (LHCI) is a tool for running Lighthouse audits on your codebase and tracking the results over time. It includes a server and CLI for managing Lighthouse runs and storing results. While @lhci/utils provides utility functions to support LHCI, lighthouse-ci is the main package for setting up and running Lighthouse CI.
Lighthouse Batch is a tool for running multiple Lighthouse audits in parallel. It is useful for auditing multiple URLs at once. While @lhci/utils provides utilities for handling individual Lighthouse runs and configurations, lighthouse-batch focuses on running multiple audits concurrently.
The Lighthouse CI Utils supports the @lhci/cli
and @lhci/server
packages. Read the Lighthouse CI docs to learn more.
FAQs
[](https://badge.fury.io/js/%40lhci%2Futils)
The npm package @lhci/utils receives a total of 159,450 weekly downloads. As such, @lhci/utils popularity was classified as popular.
We found that @lhci/utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.