cloudinary-microurl
Advanced tools
Comparing version 1.2.0 to 1.3.0
{ | ||
"name": "cloudinary-microurl", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "A tiny library to generate cloudinary URLs from options objects", | ||
"main": "url.js", | ||
"main": "dist/cloudinaryUrl.js", | ||
"source": "cloudinaryUrl.js", | ||
"module": "dist/cloudinaryUrl.m.js", | ||
"repository": "peterpme/cloudinaryUrl.git", | ||
"homepage": "git@github.com:peterpme/cloudinary-microurl.git", | ||
"keywords": [ | ||
"cloudinary", | ||
"cloudinary-url" | ||
], | ||
"scripts": { | ||
"test": "node test.js" | ||
"prepare": "microbundle", | ||
"test": "jest", | ||
"test:watch": "jest --watch", | ||
"release": "npm run -s prepare && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" | ||
}, | ||
"author": "Joseph Gentle <me@josephg.com>", | ||
"license": "ISC", | ||
"files": [ | ||
"cloudinaryUrl.js", | ||
"dist" | ||
], | ||
"authors": [ | ||
"Joseph Gentle <me@josephg.com>", | ||
"Peter Piekarczyk <peter@peterp.me" | ||
], | ||
"license": "MIT", | ||
"devDependencies": { | ||
"cloudinary-core": "^2.0.8" | ||
"cloudinary-core": "2.0.8", | ||
"jest": "^22.3.0", | ||
"microbundle": "^0.4.3" | ||
} | ||
} |
@@ -1,22 +0,26 @@ | ||
# Cloudinary URL | ||
<p align="center"> | ||
<img src="https://i.imgur.com/0HShUQD.png" width="700" alt="Cloudinary MicroURL"> | ||
</p> | ||
This is a simple library to generate cloudinary URLs from an options object. | ||
# 🗜 Cloudinary Micro URL[![npm](https://img.shields.io/npm/v/cloudinary-microurl.svg)](https://npm.im/cloudinary-microurl) [![travis](https://travis-ci.org/peterpme/cloudinary-microurl.svg?branch=master)](https://travis-ci.org/peterpme/cloudinary-microurl) | ||
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. | ||
A tiny (349B), 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? | ||
## Usage | ||
### Installation | ||
```sh | ||
yarn add cloudinary-microurl | ||
``` | ||
```sh | ||
npm install cloudinary-microurl | ||
``` | ||
Then: | ||
### Usage | ||
```javascript | ||
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', { | ||
```es6 | ||
const cloudinaryUrl = require('cloudinary-microurl') | ||
const url = cloudinaryUrl('twitter.jpg', { | ||
secure: true, | ||
@@ -27,38 +31,47 @@ cloud_name: 'demo', | ||
quality: 80 | ||
}); | ||
}) | ||
// Then use it. | ||
const img = new Image; | ||
img.src = url; | ||
const img = new Image(); | ||
img.src = url | ||
``` | ||
### Supported Features | ||
### Feature support | ||
This library supports the following Cloudinary features: | ||
This library only supports the following cloudinary features: | ||
- Secure | ||
- Fetch format | ||
- Crop | ||
- Effect | ||
- Fetch format | ||
- Flags | ||
- Gravity | ||
- Width / height | ||
- Height | ||
- Radius | ||
- Quality | ||
- Width | ||
- Dpr | ||
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. | ||
Here's what they look like in code: | ||
```es6 | ||
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](http://cloudinary.com/documentation/fetch_remote_images#remote_image_fetch_url). You need to enable it in the [security options](https://cloudinary.com/console/settings/security). The image name should be a full URL. | ||
Set `{source: 'fetch'}` to activate cloundinary [fetch mode](http://cloudinary.com/documentation/fetch_remote_images#remote_image_fetch_url). You need to enable it in the [security options](https://cloudinary.com/console/settings/security). The image name should be a full URL. | ||
### Contributions | ||
### Maintainance | ||
If there's an effect thats missing, create an Issue or an PR. It's SUPER EASY! | ||
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](mailto:me@josephg.com). | ||
### Thanks to the original author | ||
This library was originally created by [josephg](https://github.com/josephg) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
10697
9
77
0
3
49
3
1