Giter Site home page Giter Site logo

peterpme / cloudinary-microurl Goto Github PK

View Code? Open in Web Editor NEW
14.0 4.0 3.0 411 KB

A tiny (346B), 0 dependency, fully-tested Cloudinary URL generator for JS

Home Page: https://npm.im/cloudinary-microurl

License: MIT License

JavaScript 100.00%
cloudinary cloudinary-url javascript

cloudinary-microurl's Introduction

Cloudinary MicroURL

๐Ÿ—œ Cloudinary Micro URLnpm travis

A tiny (346B), 0 dependency, fully-tested library to generate Cloudinary URLs from an options object.

The official Cloudinary js library is ~600kb. This saves you 1700%. If this were a crypto coin, you wouldn't be here, would you?

Installation

yarn add cloudinary-microurl
npm install cloudinary-microurl

Usage

const cloudinaryUrl = require('cloudinary-microurl')
const url = cloudinaryUrl('twitter.jpg', {
  secure: true,
  cloud_name: 'demo',
  gravity: 'face',
  flags: 'progressive',
  quality: 80
})

const img = new Image();
img.src = url

Supported Features

This library supports the following Cloudinary features:

  • Fetch format
  • Crop
  • Effect
  • Flags
  • Gravity
  • Height
  • Radius
  • Quality
  • Width
  • Dpr

Here's what they look like in code:

fetch_format: "f",
crop: "c",
effect: "e",
flags: "fl",
gravity: "g",
height: "h",
radius: "r",
quality: "q",
width: "w",
dpr: "dpr"

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.

Contributions

If there's an effect thats missing, create an Issue or an PR. It's SUPER EASY!

Thanks to the original author

This library was originally created by josephg

cloudinary-microurl's People

Contributors

cbhoweth avatar josephg avatar peterpme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.