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

lazyset

v1.0.1

Published

automate the creation of responsive images for the srcset attribute

Readme

Lazyset

Automate the creation of responsive images for the srcset attribute.

While writing, you shouldn't have to worry about responsive images. Automate the process, and let Lazyset handle it for you.

Install

$ npm install lazyset

Usage

Need a specific image resized?

$ lazyset create ./path/file.ext --width 400.

Want multiple sizes? Just separate the other widths by commas, e.g., --width 400,700,1200

Height is auto generate to preserve dimensions

need me to watch a directory for you?

$ lazyset watch ./path/ --width 400,800,1200

Any image you add to the chosen directory, will automatically generate resized replicas, with the width appended to the file name.

You can create an HTML snippet like the one below, and trust that lazyset will do the rest.

  <img src="./path/foo.png"
       srcset="./path/foo-1200.png 800w,
               ./path/foo-800.png 800w,
               ./path/foo-400.png 400w"
        sizes="max-width: 100%"
        alt="Responsive images aren't that annoying anymore">
Do you use Jekyll, or any other static site generator, and write in markdown?

You can turn the code above into a partial, include it in your markdown with the chosen image, and never have to worry about responsive images again.

Using liquid templating in Jekyll, for example:

// ./includes/image.html

<figure
  <img  src="./img/{{include.name}}.{{incude.type}}"
        srcset="./img/{{include.name}}-1200.{{include.type}} 1200w,
               ./img/{{include.name}}-800.{{include.type}} 800w,
               ./img/{{include.name}}-400.{{include.type}} 400w"
         sizes="max-width: 100%"
         alt="{{include.name | split: '-'}}">
</figure>
// ./_posts/08-19-17-lazyload.md

{% include image.html name="foo" type="png %}

Just run the lazyload watch command before you start writing, and add the desired image in the chosen directory.

Now all it takes is one line of work to include responsive images in your writing.

Sample

$ lazyset create './sample/lazyset.png` --width 800,400

Original Image:

lazyset.png

original

Created Images:

lazyset-800.png

created at 800

lazyset-400.png

created at 400

TODO

  • add tests
  • add bagdes
    • https://github.com/dwyl/repo-badges
    • https://medium.com/@jdaudier/how-to-create-and-publish-your-first-node-js-module-444e7585b738#.o83xl3ss1

License

Open sourced under the MIT license.