server-image-transformer-sharp
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

Remix-Image-Sharp

👋 Intro

A Sharp transformer for Remix-Image

🚀 How to use

Install

To install this library, use one of the following commands:

npm install -S remix-image-sharp sharp
yarn add remix-image-sharp sharp

Implement

To use this transformer, set the transformer property in your ImageLoader API route:

import type { LoaderFunction } from "remix";
import { sharpTransformer } from "remix-image-sharp";
import { imageLoader, DiskCache } from "remix-image/server";

const config = {
  selfUrl: "http://localhost:3000",
  cache: new DiskCache(),
  transformer: sharpTransformer,
};

export const loader: LoaderFunction = ({ request }) => {
  return imageLoader(config, request);
};

Docs

/server-image-transformer-sharp/

    Package Sidebar

    Install

    npm i server-image-transformer-sharp

    Weekly Downloads

    0

    Version

    0.2.2

    License

    MIT

    Unpacked Size

    17.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • sebasgarcep