This project enables you to create Cloudinary URLs for your images. Using this SDK, you can apply advanced transformations to your images.
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:
- ESM packages, import only what you need
- Declarative Syntax
- Fully typed for excellent IDE support
- Easy to write, easy to read.
npm install @cloudinary/base
@cloudinary/base is optimized around bundle size, as such we do not transpile our distributed modules, we leave the decision of what browsers to support, and what transpilations to apply, to you, the user.
As mentioned above, we're shipping @cloudinary/base with ES6 code, as this provides great tree-shaking potential. it also requires a few adjustments when testing.
In jest.config, you'll need to add these lines to allow babel to transpile our code.
{
"transform": {
"node_modules/@cloudinary/base": "babel-jest"
},
"transformIgnorePatterns": ["/node_modules/(?!@cloudinary/base)"]
}
Make sure to install babel-jest:
npm install babel-jest
You'll also need to ensure you have a babel.config.js file (and not a .babelrc), and that it's configured properly to transpile code,
As an example:
module.exports = {
"presets": [
"@babel/preset-env"
]
};
Feel free to visit our more mature SDKs: