Skip to content

mapado/image-url-builder-js

Repository files navigation

Mapado Image JS Url Builder

Installation

npm install "@mapado/image-url-builder"

or with yarn:

yarn add "@mapado/image-url-builder"

Usage

import { buildUrl } from '@mapado/image-url-builder';

const imagePath = '2018/01/foo.jpg';
const fullWidthImage = buildUrl(imagePath);

// will output something like '//img.mapado.net/2018/01/foo.jpg'

You can also specify a width and a height to crop the image:

const width = 400;
const height = 300;
const cropedImage = buildUrl(imagePath, width, height);

// will output something like '//img.mapado.net/2018/01/foo_thumbs/400-300.jpg'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published