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

@snowcone-app/resizer

v1.0.0

Published

Image resizing service using imgproxy

Readme

Resizer Service

The Resizer service is responsible for resizing images using imgproxy. It connects to the render-queue service via Redis Streams to get resize tasks.

Architecture

The service works with two key components:

  1. Redis Streams for task distribution
  2. imgproxy for actual image resizing

Task Processing Flow

  1. Resize tasks are published to a Redis Stream (resize_stream) by other services
  2. Multiple resizer instances join a consumer group (resize_group) to read tasks in a round-robin fashion
  3. Each instance processes its tasks and acknowledges completion
  4. If a task processing fails, it remains in the "pending" state and can be claimed by other instances

Features

  • Horizontal Scaling: Multiple resizer instances can work together through Redis Streams consumer groups
  • Fault Tolerance: If one instance fails, tasks are automatically redistributed
  • Load Balancing: Tasks are distributed evenly across all resizer instances
  • Retry Mechanism: Automatically claims failed tasks after a timeout period

Configuration

The service can be configured using environment variables:

| Variable | Description | Default | | ---------------------- | ----------------------------------------------- | ----------------------- | | IMGPROXY_URL | URL of the imgproxy service | http://localhost:8101 | | MAX_CONCURRENT_TASKS | Maximum number of tasks to process concurrently | 3 | | HEALTH_PORT | Port for the health check server | 8095 | | REDIS_ADDR | Redis server address (host:port) | localhost:6379 | | REDIS_PASSWORD | Redis password | "" (empty) | | CONSUMER_ID | Optional unique ID for this consumer | Auto-generated |

Installation and Setup

Local Development

  1. Install dependencies:

    npm install
  2. Make sure Redis is running and accessible at your configured REDIS_ADDR

  3. Start the service in development mode:

    npm run dev

Docker Deployment

  1. Build the Docker image:

    npm run docker:build
  2. Run the container:

    docker run -p 8095:8095 --env-file .env -d snowcone-monorepo-resizer

Health Check

The service provides a health check endpoint at:

GET http://localhost:8095/healthz

Task Queuing

Tasks are added to the Redis Stream by the render-queue service. The task format is:

{
  "id": "resize_12345678",
  "type": "resize",
  "params": {
    "params": {
      "assetUrl": "https://example.com/image.jpg",
      "maxWidth": 800,
      "tempFileUrlForResizer": "https://example.com/temp-file.jpg"
    },
    "callbackUrl": "https://callback.example.com/endpoint"
  }
}

Monitoring

You can monitor the Redis Streams and consumer groups using Redis CLI:

# View tasks in the resize stream
redis-cli XRANGE resize_stream - + COUNT 10

# View consumer group info
redis-cli XINFO GROUPS resize_stream

# View pending tasks (not acknowledged)
redis-cli XPENDING resize_stream resize_group