Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cloudinary-build-url

mayashavin26.7kMIT0.2.4TypeScript support: included

Lighter Url generator for Cloudinary

cloudinary, cloudinary-url, url, video, image, optimization, api, light, typescript

readme

cloudinary-build-url

Netlify Status npm version npm downloads Codecov License

Cloudinary URL Builder(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.

📖 Documentation

Installation

yarn add cloudinary-build-url

or

npm i cloudinary-build-url

Use with TypeScript

In order to start using the lib with TypeScript, please install @cld-apis/types as devDependencies.

npm i -D @cld-apis/types

#OR

yarn add -D @cld-apis/types

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)

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

0.2.4 (2022-01-18)

Note: Version bump only for package cloudinary-build-url

0.2.3 (2022-01-18)

Note: Version bump only for package cloudinary-build-url

0.2.2 (2022-01-10)

Bug Fixes

  • remove format extension for public-id (f41d461)

0.2.1 (2021-02-03)

Bug Fixes

0.2.0 (2021-02-03)

Bug Fixes

0.1.1 (2020-12-15)

Bug Fixes

Features

  • expose transformer api, add types (049f3f2)
  • group x,y to position (19f5c50)

0.0.3 (2020-11-15)

Bug Fixes

  • change syntax structure to cloud, transformations (4df15ef)

0.0.2 (2020-11-15)

Note: Version bump only for package cloudinary-build-url