Welcome
About this project
This project enables you to create Cloudinary URLs for your images.
Using this SDK, you can apply advanced transformations to your images.
What is this project for?
This project comes to replace and modernize our existing JS offering, and it's part of a larger effort in Cloudinary.
You can read more about the project here:
Key Features
- ESM packages, import only what you need
- Declarative Syntax
- Fully typed for excellent IDE support
- Easy to write, easy to read.
Installation
npm install @cloudinary/base
Simple usage
import {TransformableImage} from '@cloudinary/base';
import {Resize} from '@cloudinary/base/actions';
import {scale} from '@cloudinary/base/actions/resize';
const myImage = new TransformableImage('sample');
myImage.setConfig({
cloud: {
cloudName: 'demo'
}
});
myImage.resize(Resize.scale().width(100).height(100));
const myURL = myImage.toURL();
Using SDK helper types/values
import {TransformableImage} from '@cloudinary/base';
import {mode} from '@cloudinary/base/actions/rotate';
import * as RotationMode from '@cloudinary/base/values/rotate';
import {verticalFlip} from '@cloudinary/base/values/rotate';
const myImage = new TransformableImage('sample');
myImage.config();
myImage.rotate(mode(verticalFlip()));
const myURL = myImage.toURL();
Progress report
We're currently working on implementing all the wide range of features and possible transformations.
We've created a progress report that visualizes our efforts:
https://cloudinary.github.io/cloudinary-js-base/public/progress/cloudinary-base-progress-report.html
Interested in Cloudinary?
Feel free to visit our more mature SDKs: