Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/hackdoor-io/imgproxy-js
- Owner: Hackdoor-io
- License: mit
- Created: 2019-09-05T13:14:55.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T09:02:50.000Z (about 2 years ago)
- Last Synced: 2024-11-16T00:23:17.927Z (2 months ago)
- Topics: browser, image-processing, imgproxy, node, nodejs
- Language: JavaScript
- Homepage:
- Size: 1.21 MB
- Stars: 18
- Watchers: 3
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
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(