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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yifancong/bundle-actions

v0.0.1

Published

A GitHub Action for bundle size analysis and reporting

Readme

Compressed Size Action Demo

This is a simplified GitHub Action for checking file compression size differences before and after code changes.

Features

  • Intelligently detects GitHub event types and automatically executes corresponding operations
  • On MR submission: Only downloads target branch artifacts (if they exist)
  • On MR merge: Only uploads current branch artifacts
  • Supports custom file paths
  • Finds target branch's latest commit through GitHub API
  • Artifacts named by commit hash to avoid conflicts

Smart Behavior

🔄 On MR Merge (push to main branch)

  • Only uploads current branch artifacts
  • Artifact naming: path-filename-commithash.extension
  • Used to save the latest baseline data

📥 On MR Submission (pull_request event)

  • Only downloads target branch artifacts (if they exist)
  • If target branch artifacts are found, downloads and compares
  • If not found, prints "No baseline data found"
  • Used to compare current changes with baseline data

Configuration

- uses: ./
  with:
    # GitHub token for API access
    github_token: ${{ secrets.GITHUB_TOKEN }}
    
    # File path to upload (relative to project root)
    file_path: 'artifacts/1.json'
    
    # Target branch (defaults to main)
    target_branch: 'main'

Artifact Naming Rules

Artifacts will be named using the following format:

  • Format: path-filename-commithash.extension
  • Example: artifacts-1-f18c5686ba.json

Usage Scenarios

Scenario 1: On MR Submission

on:
  pull_request:
    types: [opened, synchronize]

The Action will:

  1. Find the latest commit of the target branch
  2. Attempt to download the corresponding artifact
  3. If real baseline data is found, use real data for comparison
  4. If not found, use built-in demo data as baseline for comparison display
  5. Generate Bundle Size Report card

Scenario 2: On MR Merge

on:
  push:
    branches: [main]

The Action will:

  1. Upload current branch artifacts
  2. Generate simple Bundle Size Report card
  3. Artifacts will serve as baseline data for subsequent MRs

Report Card Example

The Action will generate a report card in the following format in GitHub CI:

📦 Bundle Size Report

| Metric | Current | Baseline | |--------|---------|----------| | 📊 Total Size | 100.0 MB | 99.0 MB | | 📁 Files Count | 3 | 3 |

📄 File Details

| File | Size | |------|------| | dist/main.js | 50.0 MB | | dist/vendor.js | 40.0 MB | | dist/styles.css | 10.0 MB |

JSON File Format

The JSON file pointed to by your file_path should contain data in the following format:

{
  "totalSize": 104857600,
  "files": [
    {
      "path": "dist/main.js",
      "size": 52428800,
      "gzipSize": 10485760,
      "brotliSize": 8388608
    },
    {
      "path": "dist/vendor.js",
      "size": 41943040
    }
  ]
}
  • totalSize: Total size (in bytes)
  • files: File list, each file contains path and size information

Demo Baseline Data

When real artifacts from the target branch cannot be found, the Action will automatically use built-in demo data as baseline for comparison:

{
  "totalSize": 103809024,  // ~99MB
  "files": [
    {
      "path": "dist/main.js",
      "size": 51380224     // ~49MB
    },
    {
      "path": "dist/vendor.js", 
      "size": 41943040     // ~40MB
    },
    {
      "path": "dist/styles.css",
      "size": 10485760     // ~10MB
    }
  ]
}

This way, even on first run or when there's no historical data, meaningful comparison reports can be generated to help developers understand the current build size situation.

Development

# Install dependencies
npm install

# Build
npm run build