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

lean-stack-auditor

v2.3.0

Published

Find bundle bloat and replace it with vanilla JavaScript

Readme

🔍 Lean Stack Auditor

npm version License: MIT

Find bundle bloat and replace it with vanilla JavaScript.

Now powered by esbuild for accurate, real-world size analysis.

Features

  • 🎯 Real-Time Analysis: Uses esbuild to bundle your dependencies on-the-fly and calculate their actual minified + gzipped size. No more static guessing.
  • 👯 Duplicate Scanner: Detects when you have multiple versions of the same library installed (e.g., lodash v3 and v4).
  • 🧹 Bloat Detection: Automatically flags heavy libraries (Moment.js, Lodash, etc.) that can be replaced with native APIs.
  • 💡 Native Alternatives: Provides copy-paste vanilla JS alternatives for common libraries.
  • 📊 Cost Calculator: Estimates the bandwidth cost of your bundle bloat.
  • 🐢 Node.js Support: Works for both frontend and backend projects (correctly handles node: builtins).

Installation

npx lean-stack-auditor

Or install globally:

npm install -g lean-stack-auditor

Usage

Navigate to your project root (where package.json is) and run:

npx lean-stack-auditor

Options

# Verbose mode (See all dependencies, not just bloat)
lean-stack-auditor --verbose

# JSON output (Great for CI/CD)
# JSON output (Great for CI/CD)
lean-stack-auditor --json

# Auto-Fix Mode (Replace bloat with vanilla JS)
lean-stack-auditor --fix

Example Output

🔍 LEAN STACK AUDITOR
Find bloat. Ship faster.

✔ Analysis complete!

📦 Project Analysis:
Project: my-app
Total dependencies: 12
Bundle size (minified+gzipped): 127KB

⚠ Found 3 Bloated Dependencies:

1. moment.js (72KB) - CRITICAL
   Reason: Deprecated and very heavy
   Common usage: Date formatting
   Alternative: Intl.DateTimeFormat (native)
   Potential savings: 72KB

   💡 Vanilla JS Alternative:
   const formatted = new Intl.DateTimeFormat('en-US').format(new Date());

2. lodash (25KB) - HIGH
   Reason: Most projects use only 3-5 functions
   Alternative: Vanilla JS implementations
   Potential savings: 25KB

💰 Total Potential Savings: 97KB (76%)

Configuration (Budget Enforcer)

Create a lean-stack.config.json to enforce limits in CI:

{
  "maxBundleSize": "150KB",
  "disallowed": ["moment", "lodash"],
  "allowDuplicates": false
}

Run with:

lean-stack-auditor --check-budget

(Exits with code 1 if failed)

How It Works

  1. Scans package.json: Identifies your production dependencies.
  2. Bundles with esbuild: Creates a temporary, minified bundle for each dependency to inspect its true weight.
  3. Matches Patterns: Checks against a database of known "bloated" libraries to suggest native alternatives.
  4. Reports: Gives you a clear, actionable report.

License

MIT