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

qdsrcset

v1.1.6

Published

Quick and Dirty Srcset

Readme

QDsrcset

A Quick and Dirty automatic responsive image generator for plain HTML sites.

What is it for?

So you've made a website, but all the images are huge. Obviously it doesn't make sense to load the huge images on every person's iPhone 4 and 480p monitor, so most people will recommend that you create a set of images at different sizes that will load depending on the image's final size. Just one problem: it's just so annoying.

QDsrcset will automatically create a set of responsive images at a variety of sizes and implement them in your HTML. It's easy to install and configure, and can be run with a single command.

Installation & Usage

First, add qdsrcset to your website using NPM or Yarn:

npm install --save-dev qdsrcset

Next, create a configuration file in either your project's root or in a config/ folder named .qdsrcsetconfig.json. Here's an example:

{
    "inDir": "src/",
    "outDir": "out/"
}

Then, tell NPM to run the program:

npx qdsrcset

This will format a site located in inDir and place the formatted site in outDir. Don't make these the same folder.

That's it! It's certainly quick, hopefully not too dirty (and getting less dirty) srcset for each of your website's images!

Configuration

The json configuration file can be located in either /.qdsrcsetconfig.json or /config/qdsrcsetconfig.json.

It contains the following fields:

  • inDir: This is where your website is located. QDsrcset will scan here for HTML files (and images, if imgDir is not set.)
  • outDir: This is where your final, formatted website is located. It cannot be the same as inDir.
  • imgDir (Optional): This is where qdsrcset will search for images. It is relative to inDir. For example, if inDir is src/ and imgDir is img/, qdsrcset will look in src/img/ for images.
  • ignore (Optional): An array of paths to directories or files for QDsrcset to ignore. It is relative to inDir. For example, if inDir is src/ and ignore contains img/favicon/, qdsrcset will ignore src/img/favicon/.
  • sizes (Optional): An array of integer widths that each image will be resized to. If an image is smaller than some of the specified sizes, QDsrcset will simply compress the image at its original size. Defaults to: [150, 200, 300, 400, 600, 800, 1000, 1500, 2000, 2500]

Example

Let's say your website is structured like this:

myWebsite/
├── src/
│   ├── img/
│   │   ├── favicon/
│   │   │   └── favicon.ico
│   │   ├── img1.png
│   │   ├── img2.jpeg
│   │   └── img3.webp
│   ├── index.html
│   ├── stylesheet.css
│   └── page/
│       ├── index.html
│       └── stylesheet.css
└── .qdsrcsetconfig.json

Your config file might be set up like this:

{
    "inDir": "src/",
    "outDir": "out/",
    "imgDir": "img",
    "ignore": [
        "img/favicon/"
    ]
}

If, for whatever reason, you wanted a specific set of sizes for your respnsive images, the config could look like this:

{
    "inDir": "src/",
    "outDir": "out/",
    "imgDir": "img",
    "ignore": [
        "img/favicon/"
    ],
    "sizes": [
        100,
        200,
        500,
        1000,
        2000,
        4000
    ]
}