1.0.1 โ€ข Published 1 year ago

@misaon/imgproxy v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

๐Ÿ–ผ๏ธ @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'
// or commonJS
// const { getImageUrl } = require("misaon/imgproxy");

const imageUrl = getImageUrl(sourceImageUrl, {
    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)

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.

1.0.1

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0-alpha

1 year ago

0.0.0

1 year ago