contentful-image-optimiser

1.2.6 • Public • Published

Download & Installation

Download & Installation

The Contentful Image Optimiser is a lightweight module that will improve the speed and performance of any page that serves it's images via Contenful.

  • Automatically serves appropriate image size depending on device
  • Allows you to specify specific image sizes
  • Serves images in WebP format autimatically if browser support is available. Fallsback to original format if not supported
 
This will return an image with it's width set to match the browser window width. It will also
automatically change it's format to WebP if supported
 
<img src="setAutoWidth(/imageURL.png)">
 
<hr>
 
This will return an image with a specified width
 
<img src="setFixedWidth(/imageURL.png, 350)">
 
<hr>
 
This will return an image with a specified height
 
<img src="setFixedHeight(/imageURL.png, 500)">
 
<hr>
 
This will return an image with a specified height and width
 
<img src="setHeightWidth(/imageURL.png, 500, 500)">
 

Link to repo

Download & Installation

$ npm i contentful-image-optimiser

Author

  • Daragh Cassidy

License

This project is licensed under the MIT License

Readme

Keywords

Package Sidebar

Install

npm i contentful-image-optimiser

Weekly Downloads

0

Version

1.2.6

License

MIT

Unpacked Size

4.31 kB

Total Files

3

Last publish

Collaborators

  • daraghcassidy