npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-cli-cloudinary-images

v0.4.1

Published

Use images from Cloudinary easily

Downloads

13

Readme

Ember-cli-cloudinary-images

This addon contains a helper to get images URLs from Cloudinary easy. Made by HappySale

Installation

  • ember install:addon ember-cli-cloudinary-images

Required Ember version 2.1.0 and above

Usage

After installation:

  • use the helper {{cloudinary-url}} to generate images URLs
  • for ease, set CLOUDINARY config inside Application environment file

inside environment.js:

module.exports = function(environment) {
  var ENV = {
    // ···
    CLOUDINARY: {
      CLOUD_NAME: '···', // "cloud name" in Cloudinary
      SECURE: true, // use https?
      DOMAIN: '···', // dedicated domain if exists
      SUB_DOMAIN: '···', // dedicated sub-domain if exists
      CDN_DISTRIBUTION: false // use CDN distribution if needed
    }
  }
  // ···
};

using helper:


It will resolve to the image URL in Cloudinary:
<img src={{cloudinary-url "publicId"}}>

For resized image, use `width` and/or `height` for resizing:
<img src={{cloudinary-url "publicId" width="155" height="50"}}>

For using transforms, use the transforms attribute:
<img src={{cloudinary-url "publicId" transforms="c_fill"}}>

For getting twitter user's avatar:
<img src={{cloudinary-url "iamdevloper" type="twitter_name"}}>

Don't forget! you can unbound:
<img src={{unbound (cloudinary-url "publicId")}}>

Full properties list

  • cloudName - account name in Cloudinary
  • width - for resize the image's width
  • height - for resize the image's height
  • version - for choosing version of the asset
  • domain - for choosing dedicated domain if exists
  • subDomain - for choosing dedicated sub-domain if exists
  • cdnDistribution - for choosing if it will distribute between CDNs. default to false
  • secure for choosing between http to https. default to true
  • resourceType - default to image
  • type - the repository of images. default to upload but can be replaced with facebook, twitter, twitter_name and so
  • format - the image file format
  • transforms - transforms that may apply

Deprecations

The components {{c-img}} and {{c-avatar}} where deprecate for using the helper {{cloudinary-url}}.

The main reason is for having the ability to unbound for performance gains. But the side effects are:

  • using images inside SVGs
  • adding links to the full size images

NOTE: the attributes where change to be more compline with Cloudinary's terminology.

New API:

Old:
{{c-img media="publicId"}}
{{c-avatar network="twitter_name" user="iamdevloper"}}

New:
<img src={{cloudinary-url "publicId"}}>
<img src={{cloudinary-url "iamdevloper" type="twitter_name"}}>

Better:
<img src={{unbound (cloudinary-url "publicId")}}>
<img src={{unbound (cloudinary-url "iamdevloper" type="twitter_name")}}>