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

@uploadista/flow-images-photon

v0.1.0

Published

Photon image processing service for Uploadista Flow

Downloads

1,930

Readme

@uploadista/flow-images-photon

Cloudflare Photon image processing for Uploadista flows. Edge-deployed image transformations with global performance.

Overview

Photon provides serverless image processing at Cloudflare edge:

  • Edge Location: Process images at 300+ edge locations
  • Global Performance: Sub-10ms processing globally
  • No Infrastructure: Serverless image operations
  • Multiple Formats: JPEG, PNG, WebP, AVIF
  • Effects: Resize, crop, blur, sharpen, filter

Perfect for Cloudflare Workers-based upload servers.

Installation

npm install @uploadista/flow-images-photon
# or
pnpm add @uploadista/flow-images-photon

Prerequisites

  • Cloudflare Workers project
  • Photon API access (included with Workers)

Quick Start

import { imagePluginServerless } from "@uploadista/flow-images-photon";

export default {
  async fetch(request: Request, env: any) {
    // Photon processor available globally
    // Images processed at edge
  },
};

Features

  • Global Edge: 300+ locations worldwide
  • Instant: No cold starts, ~10ms latency
  • Serverless: No servers to manage
  • Auto-Scaling: Handles any traffic
  • Multiple Formats: Automatic optimization

Transformation Support

Supported vs Unsupported Transformations

Photon supports most common image transformations but has limitations compared to Sharp. Use this matrix to determine which plugin to use for your workflow:

| Transformation | Photon Support | Sharp Support | Notes | |---------------|----------------|---------------|-------| | Basic Transformations | | Resize | ✅ Full | ✅ Full | Both support width, height, fit modes | | Blur | ✅ Full | ✅ Full | Gaussian blur with sigma parameter | | Rotate | ❌ Not supported | ✅ Full | Use Sharp for rotation | | Flip | ✅ Full | ✅ Full | Horizontal and vertical flip | | Filter Transformations | | Grayscale | ✅ Full | ✅ Full | Convert to grayscale | | Sepia | ✅ Full | ✅ Full | Apply sepia tone | | Brightness | ✅ Full | ✅ Full | Adjust brightness (-100 to +100) | | Contrast | ✅ Full | ✅ Full | Adjust contrast (-100 to +100) | | Effect Transformations | | Sharpen | ✅ Full | ✅ Full | Image sharpening | | Advanced Transformations | | Watermark | ❌ Not supported | ✅ Full | Use Sharp for watermarks | | Logo overlay | ❌ Not supported | ✅ Full | Use Sharp for logo overlays | | Text overlay | ❌ Not supported | ✅ Full | Use Sharp for text rendering |

Unsupported Transformations

When using the transform method with unsupported transformation types, Photon will return a clear error:

// This will fail with Photon plugin
const result = await imagePlugin.transform(imageBytes, {
  type: 'watermark',
  imagePath: '/watermark.png',
  position: 'bottom-right',
  opacity: 0.5
});
// Error: "Photon plugin does not support 'watermark'. Use sharp plugin or remove this transformation."

Recommendation

  • Use Photon when: You need edge deployment, global performance, and only use basic transformations (resize, blur, flip, filters)
  • Use Sharp when: You need advanced features (watermarks, logos, text, rotation) or running in Node.js environment
  • Hybrid approach: Use both! Deploy Photon for fast basic operations at edge, and Sharp for advanced transformations in your origin server

Node Types

Resize (Edge)

{
  type: "resize",
  params: {
    width: 800,
    height: 600,
    fit: "cover",
  },
}

Optimize (Edge)

{
  type: "optimize",
  params: {
    quality: 85,
    format: "webp",
  },
}

Use Cases

  • Responsive images globally
  • Real-time thumbnail generation
  • Format conversion at edge
  • Global CDN integration
  • Instant image optimization

Examples

Global Responsive Images

const responsiveFlow = {
  nodes: [
    { id: "input", type: "input" },
    { id: "split", type: "multiplex", params: { outputCount: 3 } },
    {
      id: "mobile",
      type: "resize",
      params: { width: 400, height: 300, fit: "cover" },
    },
    {
      id: "tablet",
      type: "resize",
      params: { width: 800, height: 600, fit: "contain" },
    },
    {
      id: "desktop",
      type: "resize",
      params: { width: 1200, height: 900, fit: "cover" },
    },
    { id: "r2", type: "r2-store" },
    { id: "output", type: "output" },
  ],
};

Performance

| Operation | Latency | |-----------|---------| | Resize to 800x600 | ~5-10ms | | Optimize (WebP) | ~10-15ms | | Global delivery | ~50-100ms (edge+network) |

Processing at edge location closest to user.

Limitations

  • Photon Features: Subset of Sharp (most common ops supported)
  • Size Limits: 50MB recommended max
  • API Rate: Subject to Cloudflare quotas

Related Packages

License

See LICENSE in the main repository.

See Also