0.0.7 • Published 4 years ago
simple-image-cdn v0.0.7
Simple Image CDN
Simple and free image CDN
Install
yarn add simple-image-cdn
npm i simple-image-cdn
Usage
import getImageUrl from 'simple-image-cdn';
Example
const url = 'https://cdn.pixabay.com/photo/2016/03/27/18/54/technology-1283624_960_720.jpg';
const src = getImageUrl(url, {w: '100', h: '100', fit: 'cover' });
console.log(src)
//expect url:
//https://images.weserv.nl/?url=https%3A%2F%2Fcdn.pixabay.com%2Fphoto%2F2016%2F03%2F27%2F18%2F54%2Ftechnology-1283624_960_720.jpg&w=100&h=100&fit=cover
Options
You can get the full documentation here: https://images.weserv.nl/docs/
Limitation
You can only process 700 images per hour.
Special Thanks
We use Images.weserv.nl, a cool and free service. Checkout here: https://images.weserv.nl/