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-thumbor-images

v1.0.0

Published

ember-thumbor-images is a simple addon that generates safe/unsafe thumbor image urls durin build. You can use it to define your responsive images in your ember apps.

Downloads

7

Readme

ember-thumbor-images

This is a simple addon that constructs your ember-apps's images with your thumbor services's url during build. It also provides a helper and a component. The helper is useful for generating the image src attribute while the component is more powerful. The component generates responsive picture tags that would be added with <source> tags which add the right thumbor image src to the html at runtime. Thanks to @kaliber5 for ember-responsive-image from which this build time url image manipulation is inspired.

Compatibility

  • Ember.js v3.13 or above
  • Ember CLI v3.13 or above
  • Node.js v8 or above

Installation

ember install ember-thumbor-images

Usage

This addon assumes you already have a thumbor service running in your servers. For example, I host my thumbor on a heroku instance and my image assets are in a different server.

In order to use secure URL generation, you need to set environment variable THUMBOR_SECRET_KEY to use your secret key which you would have defined in thumbor's config (thumbor.conf). (NOTE: If you do not use this key, the url will default to unsafe usage).

Configurations

sourceDir: Type: String (Default: 'assets/images/')

Use your image source paths to allow this addon to generate URLs for

sizes: Type: Array (Default: [1024])

extensions: Type: Array (Default: ['jpg', 'jpeg', 'png', 'gif'])

PS: Do not change the enabled flag yet. This is WIP.

Helper

{{thumbor-src <path> <size>}}

This helper takes a path and size as argument. And returns back the thumbor secure URL back to be used.

<ResponsiveImage @src={{path}} />

This is a component that generates responsive image using <picture> tag along with a combination of <source> and <img> tags. Based on the sizes config that is set, the source tags are generated.

TODO: More to be added.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.