Socket
Socket
Sign inDemoInstall

cloudinary-microurl

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cloudinary-microurl

A tiny library to generate cloudinary URLs from options objects


Version published
Weekly downloads
661
increased by12.8%
Maintainers
1
Install size
4.87 kB
Created
Weekly downloads
 

Readme

Source

Cloudinary URL

This is a simple library to generate cloudinary URLs from an options object.

Cloudinary's official JS library is ~600k (including all of lodash). Its much too big for use in the browser. This one minifies to under 1k.

Usage

npm install cloudinary-microurl

Then:

const cloudurl = require('cloudinary-microurl');

// 'https://res.cloudinary.com/demo/image/upload/fl_progressive,g_face,q_80/my_cool_image'
const url = cloudurl('my_cool_image', {
  secure: true,
  cloud_name: 'demo',
  gravity: 'face',
  flags: 'progressive',
  quality: 80
});

// Then use it.
const img = new Image;
img.src = url;

Feature support

This library only supports the following cloudinary features:

  • Secure
  • Crop
  • Effect
  • Fetch format
  • Flags
  • Gravity
  • Width / height
  • Radius
  • Quality

Adding more cloudinary features is super easy, but I can't find a master list so I just added the features I use. If you need more features, please submit a PR.

Fetch mode

Set {source: 'fetch'} to activate cloundinary fetch mode. You need to enable it in the security options. The image name should be a full URL.

Maintainance

This is a library bourne of necessity, not love. I don't want to maintain this library going forward. If you want to maintain it, send me an email.

FAQs

Last updated on 08 Aug 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc