cloudinary-core
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.
Last updated 4 years ago by cloudinary .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install cloudinary-core 
SYNC missed versions from official npm registry.

Cloudinary Javascript Core SDK (Legacy)

About

The Javascript SDK 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 using your favorite package manager (yarn, npm)

npm install cloudinary-core

Or

yarn add cloudinary-core

Usage

Setup

There are several ways to configure cloudinary-core:

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.

Current Tags

  • 2.13.1                                ...           latest (9 months ago)

50 Versions

  • 2.13.1                                ...           9 months ago
  • 2.13.0                                ...           2 years ago
  • 2.12.3                                ...           3 years ago
  • 2.12.2                                ...           3 years ago
  • 2.12.1                                ...           3 years ago
  • 2.12.0                                ...           3 years ago
  • 2.11.4                                ...           4 years ago
  • 2.11.3                                ...           4 years ago
  • 2.11.2                                ...           4 years ago
  • 2.11.1                                ...           4 years ago
  • 2.11.0                                ...           4 years ago
  • 2.10.3                                ...           4 years ago
  • 2.10.2                                ...           4 years ago
  • 2.10.1                                ...           4 years ago
  • 2.10.0                                ...           4 years ago
  • 2.9.0                                ...           5 years ago
  • 2.8.2                                ...           5 years ago
  • 2.8.1                                ...           5 years ago
  • 2.8.0                                ...           5 years ago
  • 2.7.4                                ...           5 years ago
  • 2.7.3                                ...           5 years ago
  • 2.7.2                                ...           5 years ago
  • 2.7.1                                ...           5 years ago
  • 2.7.0                                ...           5 years ago
  • 2.6.3                                ...           6 years ago
  • 2.6.2                                ...           6 years ago
  • 2.6.1                                ...           6 years ago
  • 2.6.1-rc1                                ...           6 years ago
  • 2.6.0                                ...           6 years ago
  • 2.5.0                                ...           7 years ago
  • 2.4.0                                ...           7 years ago
  • 2.3.0                                ...           8 years ago
  • 2.2.1                                ...           8 years ago
  • 2.2.0                                ...           8 years ago
  • 2.1.9                                ...           8 years ago
  • 2.1.8                                ...           8 years ago
  • 2.1.7                                ...           8 years ago
  • 2.1.6                                ...           8 years ago
  • 2.1.5                                ...           8 years ago
  • 2.1.2                                ...           8 years ago
  • 2.1.1                                ...           8 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.9                                ...           9 years ago
  • 2.0.8                                ...           9 years ago
  • 2.0.6                                ...           9 years ago
  • 2.0.5                                ...           9 years ago
  • 2.0.3                                ...           9 years ago
  • 2.0.2                                ...           9 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Total 2
Today 1
This Week 1
This Month 2
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE