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

@lxgicstudios/img-audit

v1.0.0

Published

Audit images for web performance: detect oversized files, unoptimized formats, missing width/height attributes causing CLS, missing alt text, and missing lazy loading. Scan live URLs or local directories. Zero dependencies.

Readme

@lxgicstudios/img-audit

npm version license node

Audit images on any website or local directory for performance problems. Finds oversized files, unoptimized formats, missing width/height attributes (CLS), missing alt text, and missing lazy loading. Reports potential savings from format conversion.

Zero dependencies. Just Node.js built-ins.

Install

npm install -g @lxgicstudios/img-audit

Or run directly with npx:

npx @lxgicstudios/img-audit https://example.com

Usage

# Audit images on a live website
img-audit https://example.com

# Scan a local directory
img-audit ./public/images --dir

# Custom size threshold (flag images over 100KB)
img-audit https://example.com --max-size 100

# JSON output for CI/CD
img-audit https://example.com --json

Features

  • Detects oversized images that slow down your site
  • Flags unoptimized formats (BMP, TIFF) that shouldn't be on the web
  • Catches missing width/height attributes that cause Cumulative Layout Shift (CLS)
  • Finds images without alt text (accessibility and SEO issue)
  • Identifies images missing lazy loading
  • Detects large data URIs that should be separate files
  • Estimates potential savings from WebP/AVIF conversion
  • Scans live websites or local directories
  • Shows format breakdown with visual bar chart
  • Scores your image setup out of 100
  • Zero external dependencies

Options

| Option | Description | Default | |--------|-------------|---------| | --url | Treat argument as a URL | Auto-detected | | --dir | Treat argument as a local directory | Auto-detected | | --max-size <kb> | Flag images larger than this (KB) | 200 | | --json | Output results as JSON | false | | --timeout <ms> | Request timeout in milliseconds | 15000 | | --help | Show help message | |

What It Checks

| Check | Severity | Why It Matters | |-------|----------|---------------| | Missing alt text | Error | Accessibility and SEO ranking factor | | Missing dimensions | Warning | Causes CLS (Core Web Vital) | | Oversized files | Warning | Slows page load | | BMP/TIFF format | Error | Not suitable for web at all | | Large PNG | Info | Consider JPEG or WebP if no transparency | | Large GIF | Warning | Convert animations to video (WebM/MP4) | | Missing lazy loading | Info | Below-fold images should lazy load | | Large data URIs | Warning | Move to separate files for caching |

Savings Estimates

The tool estimates how much you'd save by converting to WebP:

| Current Format | Typical Savings | |---------------|----------------| | BMP | ~95% smaller | | TIFF | ~90% smaller | | PNG | ~60% smaller | | GIF | ~50% smaller | | JPEG | ~30% smaller |

Example Output

img-audit v1.0.0

Fetching https://example.com...
Found 12 images. Checking each...

Score: 68/100

Summary:
  Total images: 12
  With issues: 8
  Missing alt: 3
  Missing dimensions: 5
  Missing lazy loading: 9
  Oversized: 2
  Total size: 1.8MB
  Potential savings: ~580KB (by converting to WebP)

Format Breakdown:
  JPEG     ████████████████████ 8 (67%)
  PNG      ████████ 3 (25%)
  SVG      ██ 1 (8%)

License

MIT - LXGIC Studios