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

lazy-ww

v0.1.2

Published

Simple lazy loading

Readme

LazyWW

Библиотека для отложенной загрузки img, video, iframe, scripts.

Installation

=========================

npm install --save lazy-ww

Initialize script

=========================

import LazyWW from 'lazy-ww'
LazyWW(props)

Props

========================= | Prop | Type | Default | Description | |:---|:---|:---|:---| | lazyClass | String | lazy | Класс, который отслеживает библиотека. | | loadingClass | String | loading | Класс, который будет накинут на элемент во время выполнения скрипта. | | loadedClass | String | loaded | Класс, который будет накинут после загрузки ресурса. | | distanceToVisibleArea | Number | 600 | Дистанция от нижней видимой области в px, после преодоления которой скрипт отработает. | | breakpoints | Object | {sm: 639, md: 1023, lg: 1919} | Параметры минимальной ширины экрана, которые применятся для медиа запросов в . | | placeholderSrc | String | null | Можно задать стандартный placeholder для всех картинок, который будет отображен до отработки скрипта. |

Data attributes

========================= | Attr | Description | |:---|:---| | data-src | Ссылка на оригинал ресурса | | data-srcset | Список изображений, среди которых браузер выберет нужное (необходимо указать атрибут sizes) | | data-source-mobile | Ссылка на изображение для sm breakpoints | | data-source-tablet | Ссылка на изображение для md breakpoints | | data-source-desktop | Ссылка на изображение для lg breakpoints | | data-source-xl | Ссылка на изображение для xl breakpoints |

Об API

========================

Обычно вам нужно будет использовать только API разметки. Добавьте class lazy ко всем img, video и iframe элементам, для которых планируется отложенная загрузка. Вместо src или srcset атрибутов, используйте data-src или data-srcset атрибуты:

<img data-src="image.jpg" class="lazy" />
<!-- Результат: -->
<img src="image.jpg" class="loaded" />

<!-- ////////////////////////////////////// -->

<video data-src="video-file.ogg" autoplay class="lazy"></video>
<!-- Результат: -->
<video src="video-file.ogg" autoplay class="loaded"></video>

<!-- ////////////////////////////////////// -->

<!-- retina optimized image: -->
<img data-src="image.jpg"
     data-srcset="responsive-image1.jpg 320w, 
                  responsive-image2.jpg 480, 
                  responsive-image3.jpg 800w"  
     sizes="(max-width: 320px) 280px,
            (max-width: 480px) 440px,
            800px"
     class="lazy" />
<!-- Результат: -->
<img srcset="responsive-image1.jpg 320w,
             responsive-image2.jpg 480w,
             responsive-image3.jpg 800w"
     sizes="(max-width: 320px) 280px,
            (max-width: 480px) 440px,
            800px"
     src="image.jpg">

Комбинация sourse с data-src

=========================

<!-- responsive example: -->
<img 
	src="placeholder.jpg" 
	data-src="image.jpg"
    srcset="responsive-image1.jpg 320w,
             responsive-image2.jpg 480w,
             responsive-image3.jpg 800w"
    sizes="(max-width: 320px) 280px,
            (max-width: 480px) 440px,
            800px"
	data-source-mobile="responsive-image1.webp"
	data-source-tablet="responsive-image2.webp"
	data-source-desktop="responsive-image3.webp"
	data-source-xl="responsive-image4.webp"
	class="lazy" />
<!-- Результат: -->
<picture>
  <source srcset="responsive-image1.webp" media="(max-width: 639px)" type="image/webp">
  <source srcset="responsive-image2.webp" media="(max-width: 1023px)" type="image/webp">
  <source srcset="responsive-image3.webp" media="(max-width: 1919px)" type="image/webp">
  <source srcset="responsive-image4.webp" type="image/webp">

  <img srcset="responsive-image1.jpg 320w,
               responsive-image2.jpg 480w,
               responsive-image3.jpg 800w"
       sizes="(max-width: 320px) 280px,
              (max-width: 480px) 440px,
              800px"
            src="image.jpg">
</picture>