Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudinary-jquery

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudinary-jquery

Cloudinary Client Side JS library. Cloudinary streamlines your web application’s image manipulation needs. Cloudinary's cloud-based servers automate image uploading, resizing, cropping, optimizing, sprite generation and more.

  • 2.13.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3K
decreased by-5.03%
Maintainers
1
Weekly downloads
 
Created
Source

Cloudinary jQuery Plugin

About

The Cloudinary JQuery Plugin allows you to quickly and easily integrate your application with Cloudinary. Effortlessly optimize and transform your cloud's assets.

Note

This Readme provides basic installation and usage information. For the complete documentation, see the Javascript SDK Guide.

Table of Contents

Key Features

Browser Support

Chrome, Safari, Firefox, IE 11

Installation

Install the package using:
npm install cloudinary-jquery

Or

yarn add cloudinary-jquery

Usage

Setup

Include the javascript file in your HTML. For Example:

<script src="node_modules/jquery/dist/jquery.js"                  type="text/javascript"></script>
<script src="node_modules/cloudinary-jquery/cloudinary-jquery.js" type="text/javascript"></script>

There are several ways to configure cloudinary-jquery:

As jQuery plugin

An instance of the Cloudinary jQuery main class, CloudinaryJQuery, is instantiated as $.cloudinary.

$.cloudinary.config({ cloud_name: "demo"});
Explicitly
var cl = cloudinary.Cloudinary.new( { cloud_name: "demo"});
Using the config function

// Using the config function
var cl = cloudinary.Cloudinary.new();
cl.config( "cloud_name", "demo");
From meta tags in the current HTML document

When using the library in a browser environment, you can use meta tags to define the configuration options.

The init() function is a convenience function that invokes both fromDocument() and fromEnvironment().

For example, add the following to the header tag:

<meta name="cloudinary_cloud_name" content="demo">

In your JavaScript source, invoke fromDocument():

var cl = cloudinary.Cloudinary.new();
cl.fromDocument();
// or
cl.init();
From environment variables

When using the library in a backend environment such as NodeJS, you can use an environment variable to define the configuration options.

Set the environment variable, for example:

export CLOUDINARY_URL=cloudinary://demo

In your JavaScript source, invoke fromEnvironment():

var cl = cloudinary.Cloudinary.new();
cl.fromEnvironment();
// or
cl.init();

Transform and Optimize Assets

// Apply a single transformation
cl.url( "sample", { crop: "scale", width: "200", angle: "10" })

// Chain (compose) multiple transformations
cl.url( "sample", {
  transformation: [
    { angle: -45 },
    { effect: "trim", angle: "45", crop: "scale", width: "600" },
    { overlay: "text:Arial_100:Hello" }
  ]
});

Generate Image and Video HTML Tags

  • Use the image() function to generate an HTMLImageElement
  • Use the imageTag() function to generate an ImageTag instance
  • Use the video() function to generate an HTMLVideoElement
  • Use the videoTag() function to generate a VideoTag instance

File upload

See cloudinary-jquery-file-upload.

Contributions

  • Ensure tests run locally (npm run test)
  • Open a PR and ensure Travis tests pass

Get Help

If you run into an issue or have a question, you can either:

About Cloudinary

Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive and personalized visual-media experiences—irrespective of the viewing device.

Additional Resources

Licence

Released under the MIT license.

FAQs

Package last updated on 04 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc