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

@bundle-stats/utils

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bundle-stats/utils

BundleStats utils


Version published
Weekly downloads
86K
increased by4.97%
Maintainers
3
Weekly downloads
 
Created

What is @bundle-stats/utils?

@bundle-stats/utils is a utility library for analyzing and comparing webpack bundle stats. It provides various functions to parse, normalize, and compare bundle stats, making it easier to understand the performance and size of your webpack bundles.

What are @bundle-stats/utils's main functionalities?

Parsing Webpack Stats

This feature allows you to parse raw webpack stats into a more manageable format. The `parseStats` function takes the raw stats JSON and converts it into a structured object.

const { parseStats } = require('@bundle-stats/utils');
const stats = require('./path/to/webpack-stats.json');
const parsedStats = parseStats(stats);
console.log(parsedStats);

Normalizing Webpack Stats

This feature normalizes the webpack stats, making it easier to compare different builds. The `normalizeStats` function takes the raw stats JSON and returns a normalized version.

const { normalizeStats } = require('@bundle-stats/utils');
const stats = require('./path/to/webpack-stats.json');
const normalizedStats = normalizeStats(stats);
console.log(normalizedStats);

Comparing Webpack Stats

This feature allows you to compare two sets of webpack stats. The `compareStats` function takes the current and baseline stats JSON and returns a comparison object highlighting the differences.

const { compareStats } = require('@bundle-stats/utils');
const currentStats = require('./path/to/current-stats.json');
const baselineStats = require('./path/to/baseline-stats.json');
const comparison = compareStats(currentStats, baselineStats);
console.log(comparison);

Other packages similar to @bundle-stats/utils

FAQs

Package last updated on 31 Mar 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