New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@skg-global/sharp_client

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

@skg-global/sharp_client

TBD

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Install

$ yarn add @skg-global/sharp_client

Client integration

You can be used to generate URLs for images.

import { createClient } from '@skg-global/sharp_client';

const client = createClient('http://example.com/base', 'sample-bucket');

const originalImageUrl = 'demo.png';
const options = {
  resize: { width: 200, fit: 'cover' },
};

const fooUrl = client.url(originalImageUrl, options);
 --> http://example.com/base/eyJidWNrZXQiOiJzYW1wbGUtYnVja2V0Iiwia2V5IjoiZGVtby5qcGVnIiwiZWRpdHMiOnsicmVzaXplIjp7IndpZHRoIjoyMDAsImZpdCI6ImNvdmVyIn19fQ==

Currently the following transformations can be applied to images:

Client option nameQuery param nameDescription
resize.width
resize.height
toFormatOutput image format. Valid values: every valid sharp output format string, i.e. jpeg, gif, webp.
rotateRotate the output image by either an explicit angle or auto-orient based on the EXIF sharp cropping feature.
flipFlip the image about the vertical Y axis sharp flip feature.
flopFlop the image about the vertical X axis sharp flop feature.
smartCrop(optional, object) activates the smart cropping feature for an original image (Amazon Rekognition)

FAQs

Package last updated on 28 Apr 2021

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