Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hackdoor-io/imgproxy-js

📸 JavaScript library for generating ImageProxy urls both on browser and server.
https://github.com/hackdoor-io/imgproxy-js

browser image-processing imgproxy node nodejs

Last synced: 2 months ago
JSON representation

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

Awesome Lists containing this project

README

        





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

# Installation

```bash
npm i -s @jsmonday/imgproxy
# or
yarn add @jsmonday/imgproxy
```

# Usage

```js
import ImgProxy from "@jsmonday/imgproxy";

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(500)
.extension("png")

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

```

# Methods
`@jsmonday/imgproxy` currently does not support all the **imgproxy** methods (it will do in the near future).

- `.image()`: The image to be resized
- `.width()`: Resize Width
- `.height()`: Resize height
- `.extension()`: The resized image extension
- `.gravity()`: The resize gravity
- `.enlarge(`: Enlarge image
- `.resizeType(