Socket
Socket
Sign inDemoInstall

shopify-images

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    shopify-images

A generic Javascript utility for Shopify's img_url filter


Version published
Weekly downloads
46
decreased by-19.3%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Shopify Images

A generic Javascript utility for Shopify img_url size parameters.

Installation

# with NPM
npm install --save shopify-images

# or with Yarn
yarn add shopify-images

Usage

const ShopifyImage = require('shopify-images');

const imageSrc = '//cdn.shopify.com/s/files/1/1405/0664/products/4791207-9790062099-Pizza1.jpg';
const options = {
  size: 'x320'
};

ShopifyImage(imageSrc, options);
// => '//cdn.shopify.com/s/files/1/1405/0664/products/4791207-9790062099-Pizza1_x320.jpg'

Options

Options should be passed as an object. Please see Shopify's size parameters for documentation.

All Options

{
  size: '320x320',
  crop: 'center',
  scale: '2',
  format: 'pjg'
}

This will translate to...

//cdn.shopify.com/s/files/1/1405/0664/products/4791207-9790062099-Pizza1_320x320_center@2x.progressive.jpg

Keywords

FAQs

Last updated on 17 Jul 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc