npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@milencode/bundlewatch-parsers

v2.2.4

Published

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

Readme

@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