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

frontend-performance-analyzer

v0.3.1

Published

CLI to analyze frontend performance using Lighthouse

Readme

⚡️ Frontend Performance Analyzer

A simple CLI tool to analyze frontend performance using Lighthouse and Puppeteer.

  • 🧠 Built for developers who care about performance
  • 🚀 Powered by headless Chrome and real metrics
  • 📦 Publish-ready for NPM usage
  • 🔍 Automatically validates URL accessibility before analysis
  • 📊 Comprehensive progress reporting and analysis summaries
  • 📝 Multiple export formats (HTML, JSON, Markdown)

📦 Installation

You can run it instantly via npx:

npx frontend-performance-analyzer --url https://example.com

Or install it globally:

npm install -g frontend-performance-analyzer

🚀 Usage

Analyze a Single URL

frontend-performance-analyzer --url https://example.com

Analyze Multiple URLs

frontend-performance-analyzer --url https://example.com https://github.com

Load URLs from File

frontend-performance-analyzer --input urls.txt
# or
frontend-performance-analyzer --input urls.json

Export Reports

# Save HTML report (automatically named based on URL)
frontend-performance-analyzer --url https://example.com --output

# Save JSON report to file
frontend-performance-analyzer --url https://example.com --json-file report.json

# Save Markdown summary (automatically named based on URL)
frontend-performance-analyzer --url https://example.com --markdown

# Output raw JSON to console
frontend-performance-analyzer --url https://example.com --json

Logging and Verbosity Options

# Verbose output with debugging details
frontend-performance-analyzer --url https://example.com --verbose

# Minimal output (errors and final results only)
frontend-performance-analyzer --url https://example.com --silent

Use Performance Threshold

Exit with failure if score is below threshold:

frontend-performance-analyzer --url https://example.com --threshold 85

🔍 URL Validation & Accessibility

The tool automatically:

  • ✅ Validates URL format before analysis
  • 🔍 Checks URL accessibility with HEAD requests and 10-second timeout
  • ⚠️ Warns about inaccessible URLs and skips them
  • 📊 Provides detailed progress reporting during analysis
  • 🔄 Continues analysis even if some URLs fail

📊 Sample Output

🔍 Checking URL accessibility...
  Checking https://example.com... ✅
✅ 1 URL(s) are accessible and will be analyzed

🚀 Starting Lighthouse analysis...

[1/1] 🔍 Analyzing https://example.com...
  └─ Launching browser...
  └─ Analysis complete!

📊 Performance Metrics for https://example.com
Score: 93/100

First Contentful Paint: 1.2 s
Speed Index: 1.9 s
Largest Contentful Paint: 1.4 s
Time to Interactive: 1.6 s
Total Blocking Time: 30 ms
Cumulative Layout Shift: 0.01

📋 Analysis Summary:
✅ Successful: 1
❌ Failed: 0
📊 Total analyzed: 1

📁 Input File Formats

  • .txt: List of URLs separated by new lines
  • .json: JSON array of URLs, e.g. ["https://example.com", "https://github.com"]

📄 Export Formats

HTML Reports

  • Full Lighthouse HTML report with all details
  • Automatically named based on URL (e.g., example_com.html)

JSON Reports

  • Structured JSON output with performance metrics
  • Includes timestamp, tool version, and detailed scores
  • Supports both single URL and batch analysis
  • Contains all Lighthouse categories (Performance, Accessibility, Best Practices, SEO, PWA)

Markdown Reports

  • Human-readable performance summary
  • Core Web Vitals breakdown with visual indicators
  • Performance opportunities and diagnostics
  • Category scores with emoji indicators
  • Automatically named based on URL (e.g., example_com.md)

🚨 Error Handling & Validation

The tool provides comprehensive validation and error handling:

  • Invalid URLs: validates URL format before processing
  • Inaccessible URLs: tests connectivity with HEAD requests and 10-second timeout
  • File validation: ensures input files exist and have correct extensions (.txt or .json)
  • Threshold validation: validates threshold values are between 0-100
  • Graceful failures: continues analysis even if some URLs fail
  • Lighthouse warnings: filters internal Lighthouse warnings for cleaner output
  • Browser management: proper cleanup of browser instances

🔧 Advanced Features

Logging Levels

  • Normal: standard output with progress indicators
  • Verbose (--verbose): detailed debugging information including timing
  • Silent (--silent): minimal output, errors and final results only

Performance Monitoring

  • Tracks analysis time per URL
  • Reports overall performance (URLs/second)
  • Browser launch and close timing
  • Accessibility check timing

Batch Processing

  • Supports multiple URL analysis in a single run
  • Consolidated JSON export for batch results
  • Individual file exports for each URL
  • Progress tracking with clear indicators

🛠 Development

Clone the repo and run:

npm install
node cli.js --url https://example.com

Project Structure

├── cli.js                   # Main CLI entry point
├── lib/
│   ├── lighthouse.js        # Lighthouse analysis logic
│   ├── logger.js            # Logging utilities
│   └── url-utils.js         # URL validation and processing
└── report-formatters/
    ├── console.js           # Console output formatting
    ├── json.js              # JSON export functionality
    └── markdown.js          # Markdown report generation

📄 License

MIT © 2025 Oleksandr Zadvornyi