Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

πŸ–ΌοΈ Generate imgproxy url in browser and Node easily. Lightweight and Fast!

License

Notifications You must be signed in to change notification settings

misaon/imgproxy

Repository files navigation

πŸ–ΌοΈ @misaon/imgproxy

npm version npm downloads Github Actions Codecov

Generate imgproxy url in browser and Node easily. Lightweight and Fast!

Features

  • πŸ‘Œ 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%

Usage

Install package:

# npm
npm install @misaon/imgproxy
# yarn
yarn add @misaon/imgproxy
# pnpm
pnpm install @misaon/imgproxy

then in your code:

import { getImageUrl } from "@misaon/imgproxy";
const imageUrl = getImageUrl("https://example.com/my-image.jpg", {
 baseURL: "https://my-imgproxy.com", // optional
 secret: "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");

Modifiers

The list of modifiers that you can use is well typed and can be found here or in imgproxy docs.

Development

  • 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

License

Made with 🧑 by @misaon

Published under MIT License.

About

πŸ–ΌοΈ Generate imgproxy url in browser and Node easily. Lightweight and Fast!

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /