Socket
Book a DemoInstallSign in
Socket

@letruxux/weserv-js

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@letruxux/weserv-js

A TypeScript library for interacting with the weserv.nl image processing service.

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

weserv-js

A TypeScript library for interacting with the weserv.nl image processing service.

Installation

npm install @letruxux/weserv-js
bun add @letruxux/weserv-js
pnpm add @letruxux/weserv-js
yarn add @letruxux/weserv-js

Basic Usage

import { ImageWeserv } from "@letruxux/weserv-js";

const imageUrl = new ImageWeserv("https://example.com/image.jpg")
  .setWidth(300)
  .setHeight(200)
  .setFit("cover")
  .setBlur(5)
  .toString();

API Documentation

Constructor

new ImageWeserv(url: string) - Creates a new instance with the source image URL.

Transformation Methods

All methods return this for method chaining.

  • setWidth(width: number) - Sets image width
  • setHeight(height: number) - Sets image height
  • setFit(fit: FitOption) - Sets resize mode (contain|cover|fill|inside|outside)
  • setBlur(blur: number) - Sets blur intensity (0-100)
  • setQuality(q: number) - Sets output quality (1-100)
  • setOutputFormat(format: OutputFormat) - Sets output format (jpg|png|gif|tiff|webp|json)

See src/defs.ts for all available options.

Keywords

weserv

FAQs

Package last updated on 19 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts