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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@aguzztn54/strapi-blurhash-plugin

v0.1.3

Published

Automatically generates Blurhash placeholders for uploaded images in Strapi CMS

Readme

Strapi Blurhash Generator Plugin

Automatically generates Blurhash placeholders for uploaded images in Strapi CMS. Provides lightweight and visually appealing placeholders optimized for lazy loading, enhancing user experience and improving performance.

Requirement

Strapi v5 or newer

Features

This plugin is inspired by and is a soft copy of Strapi Blurhash but uses Sharp and Thumbhash as the image processors, so this plugin can offering the following advantages:

  • Better detail and colors
  • Alpha support - You can keep the Transparency or fill the transparent space with any colors
  • Supports various image formats - jpeg, png, svg, avif, webp, gif

Installation

Install with npm

  npm install @aguzztn54/strapi-blurhash-plugin

Install with yarn

  yarn add @aguzztn54/strapi-blurhash-plugin

Install with pnpm

  pnpm install @aguzztn54/strapi-blurhash-plugin

Configurations

This is an example configuration on file config/plugins.ts or config/plugins.js

// config/plugins.ts
import type { BlurhashConfig } from '@aguzztn54/strapi-blurhash-plugin/dist/server/types';

interface PluginConfig extends BlurhashConfig {
  [key: string]: any;
}
export default ({ env }): PluginConfig => ({
  blurhash: {
    enabled: true,
    config: {
      regenerateOnUpdate: true,
      forceRegenerateOnUpdate: false,
      flatten: false,
      flattenColor: {
        r: 100,
        g: 150,
        b: 57,
      },
    },
  },
  // ... another Plugin
});

| Properties | Types | Default Value | Description | | ------------------------- | :----------------: | :-----------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | regenerateOnUpdate | boolean | false | Regenerate Blurhash when media is updated. If the media is replaced or cropped, this plugin will continue generating a new Blurhash string | | forceRegenerateOnUpdate | boolean | false | If false, the blurhash will only be generated if it is currently missing | | flatten | boolean | false | Remove Transparency and fill with color | | flattenColor | object \| string | white | Background color string or object, parsed by the Color Module, if unset, default color is black |

How To Get the BlurHash

The blurhash attribute will automatically appear when you populate your API endpoint. Below is an example of the response you will receive.

{
  "data": [
    {
      "id": 18,
      "documentId": "byxz57csj2ndeso36dp7gsf5",
      "title": "Ngantroe Park",
      "gallery": [
        {
          "id": 95,
          "documentId": "f8u5xd6a9bjt4khd0pzmmke3",
          "name": "f1-good-37eadc74.avif",
          "hash": "f1_good_37eadc74_00f9a877f9",
          "ext": ".avif",
          "mime": "image/avif",
          "size": 18.18,
          "url": "/uploads/f1_good_37eadc74_00f9a877f9.avif",
          "blurhash": "GBgGDIR/iGdVqGeGYcWfJvoFVw=="
        }
      ]
    }
  ]
}

How to use in Client Application

You will need Thumbhash to convert the Blurhash into an Image in your application, this module will works both in Node Server or browser environment.

// if processed in node server
const decodedHash = Buffer.from(blurhash, 'base64').toString('binary');

// if processed directly in the browser
const decodedHash = atob(blurhash);

// Generate Image URL
const arrayBuffer = Uint8Array.from(decodedHash, (c) => c.charCodeAt(0));
const base64URL = Thumbhash.thumbHashToDataURL(arrayBuffer);

License

MIT

Changelog

[0.1.3] - 09 Jul 2025

  • Add Support for API Upload

[0.1.2] - 15 Mar 2025

Major Changes

  • Use the same Sharp version as Strapi
  • Now, Blurhash is generated in the middleware before the media is uploaded to the storage server. However, updating the Blurhash still fetches the image from the Storage Server and may fail depending on your Storage Server configuration.
  • Use the same Axios package as Strapi instead of node-fetch to fetch images when regenerating Blurhash, eliminating the need for additional dependencies.
  • Optimizing Dependencies

[0.1.1] - 13 Jan 2025

  • Transparent or Flatten Blurhash Support

[0.1.0] - 12 Jan 2025

  • Initial Relase
  • Various mimetype support