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

@flightdev/image

v0.1.0

Published

Agnostic image optimization for Flight Framework. Choose your processor: Sharp, Squoosh, Cloudinary, or custom.

Downloads

247

Readme

@flightdev/image

Image optimization package for Flight Framework with Sharp, Squoosh, and CDN adapters.

Installation

npm install @flightdev/image

# Install your preferred processor:
npm install sharp           # For Node.js (fastest)
# OR use CDN adapters (no additional install needed)

Quick Start

import { createImage } from '@flightdev/image';
import { sharp } from '@flightdev/image/sharp';

const image = createImage(sharp());

// Optimize an image
const result = await image.optimize('./hero.jpg', {
  width: 800,
  format: 'webp',
  quality: 80,
});

// Generate blur placeholder
const blur = await image.blur('./hero.jpg');

// Generate responsive variants
const responsive = await image.responsive('./hero.jpg', {
  widths: [640, 768, 1024, 1280],
  formats: ['webp', 'avif'],
});

Adapters

Sharp (Node.js)

Fastest option for Node.js environments.

import { sharp } from '@flightdev/image/sharp';

const adapter = sharp({
  cache: true,        // Enable internal cache
  concurrency: 4,     // Parallel processing
  simd: true,         // SIMD optimization
});

Squoosh (Edge/WASM)

Works on Edge runtimes (Cloudflare Workers, Vercel Edge).

import { squoosh } from '@flightdev/image/squoosh';

const adapter = squoosh();

Cloudinary (CDN)

CDN-based optimization, no local processing.

import { cloudinary } from '@flightdev/image/cloudinary';

const adapter = cloudinary({
  cloudName: 'my-cloud',
  apiKey: process.env.CLOUDINARY_API_KEY,
  apiSecret: process.env.CLOUDINARY_API_SECRET,
});

Imgix (CDN)

import { imgix } from '@flightdev/image/imgix';

const adapter = imgix({
  domain: 'my-source.imgix.net',
  secureUrlToken: process.env.IMGIX_TOKEN,
});

UI Components

React

import { Image } from '@flightdev/image/react';

<Image
  src="/hero.jpg"
  alt="Hero image"
  width={800}
  height={600}
  priority           // Preload for LCP
  placeholder="blur" // Show blur while loading
  blurDataUrl={blur} // From image.blur()
/>

Vue

<script setup>
import { FlightImage } from '@flightdev/image/vue';
</script>

<template>
  <FlightImage
    src="/hero.jpg"
    alt="Hero"
    :width="800"
    :height="600"
    priority
    placeholder="blur"
  />
</template>

Svelte

<script>
  import { createImageProps, lazyImage } from '@flightdev/image/svelte';
  
  const props = createImageProps({
    src: '/hero.jpg',
    alt: 'Hero',
    width: 800,
    height: 600,
  });
</script>

<img {...props} use:lazyImage={blurDataUrl} />

Solid

import { Image } from '@flightdev/image/solid';

<Image
  src="/hero.jpg"
  alt="Hero"
  width={800}
  height={600}
  priority
  placeholder="blur"
/>

API Reference

ImageOptimizeOptions

| Option | Type | Default | Description | |--------|------|---------|-------------| | width | number | - | Target width | | height | number | - | Target height | | format | ImageFormat | 'auto' | Output format | | quality | number | 80 | Quality (1-100) | | fit | ImageFit | 'cover' | Resize fit mode | | blur | boolean | false | Generate blur placeholder | | withoutEnlargement | boolean | false | Prevent upscaling | | preserveMetadata | boolean | false | Keep EXIF data |

ImageFormat

'jpeg' | 'png' | 'webp' | 'avif' | 'gif' | 'tiff' | 'auto'

ImageFit

'cover' | 'contain' | 'fill' | 'inside' | 'outside'

Creating Custom Adapters

Implement the ImageAdapter interface:

import type { ImageAdapter } from '@flightdev/image';

export function myAdapter(config: MyConfig): ImageAdapter {
  return {
    name: 'my-adapter',
    
    supportsFormat(format) {
      return ['webp', 'jpeg', 'png'].includes(format);
    },
    
    async getMetadata(input) {
      // Return image dimensions, format, etc.
    },
    
    async optimize(input, options) {
      // Process and return optimized image
    },
    
    async generateBlurPlaceholder(input, size) {
      // Return base64 blur placeholder
    },
    
    async generateResponsive(input, config) {
      // Generate multiple sizes
    },
  };
}

License

MIT