New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@milencode/bundlewatch-parsers

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@milencode/bundlewatch-parsers

Parse existing bundle analyzer outputs instead of re-analyzing files.

latest
npmnpm
Version
2.3.0
Version published
Maintainers
1
Created
Source

@milencode/bundlewatch-parsers

Parse existing bundle analyzer outputs instead of re-analyzing files.

Why?

Existing tools like webpack-bundle-analyzer and rollup-plugin-visualizer already do excellent analysis and visualization. Instead of duplicating that work, BundleWatch parses their output and adds:

  • ✅ Time-series tracking (git-based storage)
  • ✅ Build comparisons
  • ✅ Trend analysis
  • ✅ CI/CD integration
  • ✅ Alerting

Result: 10-100x faster than re-analyzing files!

Supported Formats

Webpack Stats

import { parseWebpackStats } from '@milencode/bundlewatch-parsers';
import stats from './stats.json';

const metrics = parseWebpackStats(stats, {
  branch: 'main',
  commit: 'abc123',
  estimateCompression: true, // Estimate gzip/brotli sizes
});

// metrics is now in BuildMetrics format
// Ready for comparison, storage, etc.

Coming Soon

  • parseRollupVisualizer() - Parse rollup-plugin-visualizer output
  • parseViteManifest() - Parse Vite's .vite/manifest.json
  • parseNextjsStats() - Parse Next.js build output

Usage with Webpack

// webpack.config.js
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');

module.exports = {
  plugins: [
    new BundleAnalyzerPlugin({
      analyzerMode: 'json',      // Generate stats.json
      generateStatsFile: true,
      statsFilename: 'stats.json',
    }),
  ],
};

Then in your CI/post-build:

import { parseWebpackStats } from '@milencode/bundlewatch-parsers';
import { GitStorage } from '@milencode/bundlewatch-core';
import fs from 'fs';

// Read their stats
const stats = JSON.parse(fs.readFileSync('dist/stats.json', 'utf-8'));

// Parse to our format (< 1ms)
const metrics = parseWebpackStats(stats);

// Add our layer (time-series tracking)
const storage = new GitStorage();
await storage.save(metrics);

// Compare against baseline
const baseline = await storage.load('main');
const comparison = compare(metrics, baseline);

console.log(comparison); // See what changed!

Performance

Before (re-analyzing files):

  • Read all files from disk: ~500ms
  • Compress with gzip: ~800ms
  • Compress with brotli: ~600ms
  • Total: ~2 seconds

After (parsing stats):

  • Parse JSON: <1ms
  • Total: <1ms

~2000x faster!

API

parseWebpackStats(stats, options)

Converts webpack stats.json to BuildMetrics format.

Parameters:

  • stats - Webpack stats object (from stats.json)
  • options (optional):
    • branch - Git branch name
    • commit - Git commit hash
    • estimateCompression - Estimate gzip/brotli sizes (default: true)

Returns: BuildMetrics object

License

MIT

FAQs

Package last updated on 26 Dec 2025

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