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

@ngblaylock/blunt-images

v1.0.0-beta.8

Published

A quick image resizing and optimization utility using Sharp for static sites.

Readme

Blunt Images

Blunt Images is a quick and easy option for adding optimized images to any static site generation tool (like 11ty or SvelteKit). A lot of my inspiration for this is a mesh between Nuxt Image and Strapi's Media Library.

"Blunt" comes from two things. First, it is an antonym of "Sharp", the package I use for resizing. I use an antonym because this is a hacky solution to my problem. "Blunt" can also mean that it is very straightforward, which I believe this package does well.

If anyone has a better way to do this, let me know. This is my hacky way to accomplish a need.

I have already looked at vite-imagetools (I don't like all the imports).

This was created so I could add one image to my directory which would trigger Node to generate multiple sizes. For example, I can upload an image to ./images/image-name.jpg directory and based on my configuration file it would create ./optimized-images/thumb_image-name.jpg as well as ./optimized-images/large_image-name.jpg. That way I don't have to create two sizes of the same images in Photoshop or Figma and export them.

This is intended to run in parallel with any static site generator, so you can pair it with whatever you might have in npm run dev, npm run build, or comparative script.

The main drawback with this script is that it may create images that you might not actually use in your site.

Configuration

Step 1

Run npm install @ngblaylock/blunt-images.

Step 2

Create a blunt.config.js file with the following boilerplate. You can refer to my test blunt.config.js for a more robust example.

module.exports = [
  {
    input: "./images", // REQUIRED - relative to the `blunt.config.js` file
    output: "./optimized-images", // REQUIRED - relative to the `blunt.config.js` file
    includeOriginal: false, // OPTIONAL - Boolean, default false. This will provide a optimized image at the original width and height (sizes have no effect here)
    preserveFileStructure: false, // OPTIONAL - Boolean, default false. If true, this will preserve the same folder structure in the output directory used in the input directory. If false, it will output all files directly under the output directory
    sizes: {
      // Provide at least one size. The object key here will be the name of the file prefix. All images generated with this example will be prefixed with 'thumb_'
      thumb: {
        // OPTIONAL - but you must include width and/or height
        // See: https://sharp.pixelplumbing.com/api-resize
        width: 100,
        height: 100,
        fit: "contain",
        position: "centre",
        background: { r: 0, g: 0, b: 0, alpha: 1 },
        withoutEnlargement: true,
      },
    },
  },
];

Step 3

Add the following to your package.json

"scripts": {
  "blunt:watch": "node ./node_modules/@ngblaylock/blunt-images ./blunt.config.js --watch", // Or use -w instead of --watch
  "blunt": "node ./node_modules/@ngblaylock/blunt-images ./blunt.config.js"
},

Step 4

Run npm run blunt:watch to start watching the input directory(s). Whatever images are there will re-generate and any new images added will be watched and generated. If you don't need to watch new files, just exclude the --watch or the -w.

Suggestion

The optimized images probably don't need to be tracked by Git. As long as the original images are there whenever you run the script it will re-generate them for you.

Handle ESM Type Package

If you have "type": "module" in your package.json you will likely get an error saying that blunt.config.js can't work. All you need to do is change your config file extension to .cjs like blunt.config.cjs and update the filename in your npm script.