Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@giakki/responsive-adapter-ext

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@giakki/responsive-adapter-ext

Custom adapter for responsive-loader

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

responsive-adapter-ext

Custom Sharp adapter for responsive-loader.

Installation

npm install --save-dev responsive-adapter-ext responsive-loader sharp

Usage

import { adapter} from 'responsive-loader-ext';

...

{
    test: /\.(jpe?g|png)$/i,
    loader: 'responsive-loader',
    options: {
        adapter,
    },
}

Supported operations

In addition to the standard operations supported by responsive-loader, this adapter supports resizing by aspect ratio and by height.

For example, starting with this reference image (512x512 pixels):

Original

Resizing and cropping by aspect ratio

require('lenna.png?resize=true&width=512&aspectRatio=7/5');

Image cropped by aspect ratio

Resizing and cropping by height

require('lenna.png?resize=true&height=100');

Image resized by height

License

MIT

Keywords

responsive-loader

FAQs

Package last updated on 14 Jan 2023

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