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

@imageengine/vue3

v0.1.1

Published

Hassle-free way to deliver optimized responsive images in your Vue applications.

Downloads

20

Readme

Vue components for ImageEngine integration

Hassle-free way to deliver optimized responsive images in your Vue applications.

Quick start

The bundle includes three major components:

  • <ImageEngineProvider>
  • <Image>
  • <Source>

The only prerequisite to start using them is placing ImageEngineProvider somewhere above in the DOM tree with the deliveryAddress prop set to your ImageEngine Delivery Address :

 <template>
  <div class="content">
    <ImageEngineProvider deliveryAddress="https://blazing-fast-pics.cdn.imgeng.in">
      <picture>
        <SourceComponent
          :srcSet="[
            {
              src: `/images/pic_1_variation_1.jpg`,
              width: '500w',
            },
            {
              src: `/images/pic_1_variation_2.jpg`,
              width: '900w',
              directives: { compression: 0 },
            },
          ]"
          :attributes="{ media: '(max-width: 950px)' }"/>
        <SourceComponent
          :srcSet="[
            {
              src: `/images/pic_1_variation_1.jpg`,
              width: '500w',
            },
            {
              src: `/images/pic_1_variation_2.jpg`,
              width: '900w',
              directives: { compression: 0 },
            },
          ]"
          :attributes="{
            media: '(max-width: 950px)',
            id: 'testid',
            'data-test': 'test source attribute',
          }"/>
        <ImageComponent
          src="/images/pic_2.jpg"
          :attributes="{
            alt: 'test image',
          }"
          :directives="{
              outputFormat: 'webp',
              rotate: 45,
              inline: true
          }"/>
      </picture>
    </ImageEngineProvider>
  </div>
</template>

<script>
import {Image, Source, ImageEngineProvider} from "@imageengine/vue3";

export default {
  components: {
    ImageComponent: Image,
    SourceComponent: Source,
    ImageEngineProvider,
  },
};
</script>
 <template>
  <div id="app">
    <ImageEngineProvider deliveryAddress="https://blazing-fast-pics.cdn.imgeng.in">
        <ImageComponent src="/images/pic_2.jpg" />
    </ImageEngineProvider>
  </div>
</template>

<script>
import {Image, ImageEngineProvider} from "@imageengine/vue";

export default {
  components: {
    ImageComponent: Image,
    ImageEngineProvider
  },
};
</script>

Demo app on CodeSandbox

Component props reference

ImageEngineProvider

deliveryAddress - ImageEngine Delivery Address:

deliveryAddress: string

stripFromSrc - Strip away a portion of a source string in all ImageEngine's components. Particularly useful if your images are coming from a headless CMS and you need to erase something in received URL path (origin, for example):

stripFromSrc?: string

Image

src - Relative path to the image:

src: string

directives - ImageEngine directives:

directives?: {
  // Define desired width.
  width?: number
  // Set width to auto (with fallback).
  autoWidthWithFallback?: number
  // Define desired height.
  height?: number
  // Adjust compression.
  // Possible range: 0-100.
  compression?: number
  // Define desired output format.
  outputFormat?:
    | "png"
    | "gif"
    | "jpg"
    | "bmp"
    | "webp"
    | "jp2"
    | "svg"
    | "mp4"
    | "jxr"
    | "avif"
    | "jxl"
  // Define desired fit method.
  fitMethod?: "stretch" | "box" | "letterbox" | "cropbox" | "outside"
  // Don't apply any optimizations to the origin image.
  noOptimization?: true
  // Adjust sharpness.
  // Possible range: 0-100.
  sharpness?: number
  // Define rotation.
  // Possible range: -360 to 360.
  rotate?: number
  // Use WURFL to calculate screen's width and then scale the image accordingly.
  // Possible range: 0-100 (float).
  scaleToScreenWidth?: number
  // Crop the image [width, height, left, top].
  crop?: number[]
  // Convert the image into a data url.
  inline?: true
  // Keep EXIF data.
  keepMeta?: true
  // Force download the image
  force_download?: true
  //Maximum DPR (Device Pixel Ratio) to consider when resizing an image.
  max_device_pixel_ratio: 2.1;   // 1-4 float
}

srcSet - List of image variations for the image source set:

srcSet?: [{
  // Relative path to the image.
  src: string
  // Width descriptor.
  width: string
  // Custom optimization instructions.
  directives?: TDirectives
}]

attributes - List of additional attributes:

attributes?: [{
  // regular attribute
  alt: string
  // ...
}]

Source

srcSet - List of image variations for the image source set:

srcSet?: [{
  // Relative path to the image.
  src: string
  // Width descriptor.
  width: string
  directives?: TDirectives
}]

attributes - List of additional attributes:

attributes?: [{
  // regular attribute, ex. media: '(max-width: 950px)',
  // ...
}]