JSPM

image-proxy-yubi

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q48580F
  • License ISC

Image Proxy Yubi

Package Exports

  • image-proxy-yubi

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (image-proxy-yubi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

JavaScript library for generating ImageProxy urls both on browser and server.

Installation

npm i -s image-proxy-yubi
# or
yarn add image-proxy-yubi

Usage

import ImgProxy from 'image-proxy-yubi';

const proxy = new ImgProxy({ 
  key:  process.env.IMGPROXY_KEY, 
  salt: process.env.IMGPROXY_SALT, 
  url:  process.env.IMGPROXY_URL
});

const myResizedImage = proxy
                        .image('https://example.com/img.jpg')
                        .width(500)
                        .height(0)
                        .extension('png')

console.log(myResizedImage.get()); // => "Image URL Result"