Generate imgproxy url in browser and Node easily. Lightweight and Fast!
- ๐ Zero configuration
- ๐ช Modern, tiny and tree shaken code
- โ๏ธ Written in TypeScript
- ๐ Async-less methods and crypto computing
- ๐ Browser and Node support
- ๐ฆ Extendable and customizable
- ๐ฐ Compatible with the latest version of imgproxy
- ๐งช Covered by tests
>99%
Install package:
# npm
npm install @misaon/imgproxy
# yarn
yarn add @misaon/imgproxy
# pnpm
pnpm install @misaon/imgproxythen in your code:
import{getImageUrl}from"@misaon/imgproxy";constimageUrl=getImageUrl("https://example.com/my-image.jpg",{baseURL: "https://my-imgproxy.com",// optionalsecret: "imgproxy-secret-key",salt: "imgproxy-salt",modifiers: {width: "100",height: "75",// other modifiers... (see below)},});console.log(imageUrl);That's all! ๐ฅ
If you like use CommonJS, you can import like this:
const{ getImageUrl }=require("misaon/imgproxy");The list of modifiers that you can use is well typed and can be found here or in imgproxy docs.
- Clone this repository
- Install latest LTS version of Node.js
- Enable Corepack using
corepack enable - Install dependencies using
pnpm install - Run interactive tests using
pnpm dev
Made with ๐งก by @misaon
Published under MIT License.