Package Exports
- cloudinary-build-url
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cloudinary-build-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
cloudinary-build-url
(https://cloudinary-build-url.netlify.app)
The lighter URL builder API for Cloudinary with all features in TypeScript.
By default, f_auto
(auto format per browser) and q_auto
(auto quality per device) are enabled. And all the urls are generated as secured HTTPS format, unless user states otherwise.
Installation
yarn add cloudinary-build-url
or
npm i cloudinary-build-url
Usage
Build a delivery url for image
import { buildUrl } from 'cloudinary-build-url'
const src = buildUrl('example', {
cloud: {
cloudName: 'demo',
},
transformations: {
resize: {
type: 'scale',
width: 500,
height: 500,
}
}
})
console.log(src)
Or
import { setConfig, buildUrl } from 'cloudinary-build-url'
// Set configuration for Cloudinary
setConfig({
cloudName: 'demo'
})
// Build URL
const src = buildUrl('example', {
transformations: {
resize: {
type: 'scale',
width: 500,
height: 500,
}
}
})
console.log(src)
Build a delivery URL for video
import { buildVideoUrl } from 'cloudinary-build-url'
const src = buildVideoUrl('dog', {
cloud: {
cloudName: 'demo',
},
transformations: {
resize: {
type: 'scale',
width: 500,
height: 500,
}
}
})
console.log(src)