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 🙏

© 2026 – Pkg Stats / Ryan Hefner

cube-vue-image-lazy

v0.4.1

Published

A super simple image lazy loader for Vue.

Readme

cube-vue-image-lazy

A super simple image lazy loader for Vue.

Install

yarn add cube-vue-image-lazy

Warning: You'll need to install the w3c Intersection Observer polyfill in case you're targeting a browser which doesn't support it.

Usage

You can register the component globally so it's available in all your apps:

import Vue from 'vue'
import ImageLazy from 'cube-vue-image-lazy'

Vue.use(ImageLazy)

// Or you can override defaults
Vue.use(ImageLazy, {
  name: 'ImageLazyLoad',
  delay: 500,
  baseClass: 'image-lazy-load',
  deferredClass: 'image-lazy-load-deferred',
  loadingClass: 'image-lazy-load-loading',
  loadedClass: 'image-lazy-load-loaded'
})

Or use it locally in any of your components:

<template>
  <div id="App">
    <ImageLazy
      class="photo"
      src="https://source.unsplash.com/random/200x200"
      srcset="https://source.unsplash.com/random/400x400 2x"
      baseClass="image-lazy"
      deferredClass="image-lazy-deferred"
      loadingClass="image-lazy-loading"
      loadedClass="image-lazy-loaded"
      :delay="500"
      @loading="loading = true"
      @load="loaded = true"
    />
  </div>
</template>

<script>
  import ImageLazy from 'cube-vue-image-lazy'

  export default {
    components: {
      ImageLazy
    },
    data() {
      return {
        loading: false,
        loaded: false
      }
    }
  }
</script>

<style>
  .image-lazy {
    opacity: 0;
  }
  .image-lazy-loading {
    filter: blur(5px);
    transform: translateY(1rem);
  }
  .image-lazy-loaded {
    transition: opacity 2s ease, transform 1s ease, filter 1s ease;
    opacity: 1;
    transform: none;
    filter: none;
  }
</style>

Props

| Name | Required | Type | Default | Description | | ------------- | -------- | ------- | --------------------- | ------------------------------------------------------------------------------ | | eager | false | Boolean | false | Do not wait the image appears in the viewport and loads the image immediately. | | delay | false | Number | 0 | The delay in ms before showing up the image. | | baseClass | false | String | 'image-lazy' | The name of the class always added to the image. | | deferredClass | false | String | 'image-lazy-deferred' | The name of the class added while the loading of the image is deferred. | | loadingClass | false | String | 'image-lazy-loading' | The name of the class added while the image is loading. | | loadedClass | false | String | 'image-lazy-loaded' | The name of the class added when the image is loaded. |

Events

| Name | Description | | ------- | --------------------- | | loading | The image is loading. | | load | The image is loaded. |

Development Setup

# Project setup
yarn install

# Compiles and hot-reloads for development – Run the demo
yarn serve

# Compiles and minifies for production
yarn build

# Builds the npm ready packages
yarn bundle

# Watches for file changes and builds the npm ready packages accordingly
yarn watch

# Lints and fixes files
yarn lint

# Run the unit tests
yarn test:unit