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

@ereo/plugin-images

v0.2.15

Published

Complete image optimization plugin for the EreoJS framework. Provides automatic image optimization, blur placeholders, responsive srcset generation, and art direction support.

Readme

@ereo/plugin-images

Complete image optimization plugin for the EreoJS framework. Provides automatic image optimization, blur placeholders, responsive srcset generation, and art direction support.

Installation

bun add @ereo/plugin-images sharp

Quick Start

// ereo.config.ts
import { defineConfig } from '@ereo/core';
import images from '@ereo/plugin-images';

export default defineConfig({
  plugins: [
    images({
      formats: { webp: true, avif: true },
      quality: 80,
    }),
  ],
});
// In your components
import { Image, Picture } from '@ereo/plugin-images/components';
import heroImg from './hero.jpg';

function Hero() {
  return (
    <Image
      src={heroImg}
      alt="Hero image"
      placeholder="blur"
      priority
    />
  );
}

Key Features

  • Automatic Optimization: Compress and resize images at build time
  • Modern Formats: Generate WebP and AVIF variants automatically
  • Blur Placeholders: Create LQIP (Low Quality Image Placeholders) for smooth loading
  • Responsive Images: Generate srcset with multiple sizes for different viewports
  • Image and Picture Components: React components with built-in optimization
  • Dominant Color Extraction: Extract colors for placeholder backgrounds using k-means clustering
  • Runtime Middleware: On-demand image processing in development
  • Build-time Processing: Batch optimize all images during production build
  • Two-Tier Caching: Memory and disk caching for optimized images
  • Format Negotiation: Automatic best format selection based on browser Accept header

Supported Formats

Input: JPEG, PNG, WebP, AVIF, GIF, SVG

Output: WebP, AVIF, JPEG, PNG

Exports

Main Plugin

import images from '@ereo/plugin-images';
// or
import { imagesPlugin } from '@ereo/plugin-images';

Components

import { Image, Picture } from '@ereo/plugin-images/components';

Processing Utilities

import {
  // Image processor
  createImageProcessor,
  ImageProcessor,
  createSharpProcessor,
  SharpProcessor,

  // Blur generation
  generateBlurPlaceholder,
  generateShimmerSVG,
  generateShimmerDataURL,

  // Color extraction
  extractDominantColor,
  rgbToHex,
  hexToRgb,
  getContrastColor,
} from '@ereo/plugin-images';

Build Utilities

import {
  createBuildOptimizer,
  optimizeImages,
  BuildOptimizer,
  createManifestManager,
  ImageManifestManager,
} from '@ereo/plugin-images';

Runtime Utilities

import {
  createImageMiddleware,
  imageMiddleware,
  MemoryCache,
  DiskCache,
  TwoTierCache,
  generateCacheKey,
} from '@ereo/plugin-images';

Configuration Utilities

import {
  validateConfig,
  matchesRemotePattern,
  ConfigValidationError,
  DEFAULT_DEVICE_SIZES,
  DEFAULT_IMAGE_SIZES,
  DEFAULT_QUALITY,
  MAX_DIMENSION,
  IMAGE_PATH_PREFIX,
  SUPPORTED_INPUT_FORMATS,
  SUPPORTED_OUTPUT_FORMATS,
  FORMAT_MIME_TYPES,
  getAllSizes,
  getSizesForWidth,
} from '@ereo/plugin-images';

TypeScript Types

import type {
  ImageProps,
  PictureProps,
  PictureSource,
  StaticImageData,
  PlaceholderType,
  ObjectFit,
  ObjectPosition,
  ImageLoading,
  ImageDecoding,
  ImageLoader,
  ImageLoaderParams,
  ImagePluginConfig,
  RemotePattern,
  ImageManifestEntry,
  ImageVariant,
  ImageOptimizationParams,
  ProcessedImage,
} from '@ereo/plugin-images';

Documentation

For full documentation, visit the EreoJS Images Plugin Documentation.

Documentation Sections

Part of EreoJS

This package is part of the EreoJS monorepo - a modern full-stack JavaScript framework.

License

MIT