Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc