1.1.0 • Published 2 years ago

@23g/cdn-helper v1.1.0

Weekly downloads
5
License
ISC
Repository
github
Last release
2 years ago

@23g/cdn-helper

build_status

CDN helper

Installation

First install the package in your project.

npm install @23g/cdn-helper

or

yarn install @23g/cdn-helper

After installing make sure in your environment CDN_IMAGE_URL or MIX_CDN_IMAGE_URL (with laravel mix projects) is set with the url to the CDN.

Usage

Within our project you can use the cdn() helper function which accepts 3 parameters:

import cdn from 'cdn-helper';

/**
 * {String} path
 * {String} dimensions | (width)x(height), w(width), h(height)
 * {String} mode | crop is default, can be left empty
 **/
cdn('/yoda.jpeg', '200x200', 'crop');

Resize options

The possibel resize options passed along in the "dimensions" param are as following:

ValueAction
(width)x(height)Resize an image using both dimensions
h(height)To scale an image based on height
w(width)To scale an image based on width
1.1.0

2 years ago

1.0.11

2 years ago

1.0.12

2 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago