
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
esbuild-plugin-blurhash-as
Advanced tools
ESBuild plugin for generating Blurhash with
blurhash-as
npm install --save-dev esbuild-plugin-blurhash-as
yarn add -D esbuild-plugin-blurhash-as
NOTE: If you are using an image loader plugin that allows imports for .jpg or .png, make sure that the blurhash plugin is called first.
NOTE: If you aren't using an image loader plugin, make sure that the loader option for esbuild is set:
loader: {
'.jpg': 'file',
'.png': 'file,
},
import blurhash from 'esbuild-plugin-blurhash-as';
esbuild.build({
plugins: [
blurhash(),
],
loader: {
'.jpg': 'file',
'.png': 'file,
},
});
// Allows importing both JPG and PNG files
// Valid blurhash values includes "css", "svg", "jpg" and "png"
import * as image from './example.jpg?blurhash=css';
console.log(image);
// {
// // The blurhash of the image
// hash: '...',
// // The generated placeholder
// // For "svg", "jpg" and "png",
// // This is a string output.
// placeholder: {...},
// // The url of the image
// source: '...',
// // Dimensions of the image
// width: ...,
// height: ...,
// }
react-blurhash-asBasic Rendering
import { Blurhash } from 'react-blurhash-as';
import * as image from './example.jpg?blurhash=css';
<Blurhash
mode="css" // "svg", "canvas" or "image
src={image.source}
alt=""
width={image.width}
height={image.height}
hash={image.hash}
/>
Static Rendering
import { BlurhashStatic } from 'react-blurhash-as';
import * as image from './example.jpg?blurhash=css';
<BlurhashStatic
mode="css" // "svg" or "image"
src={image.source}
alt=""
width={image.width}
height={image.height}
placeholder={image.placeholder}
/>
You can refer to esbuild-plugin-blurhash-as/shim:
/// <reference types="esbuild-plugin-blurhash-as/shim" />
MIT © lxsmnsyc
FAQs
ESBuild plugin for blurhash-as
The npm package esbuild-plugin-blurhash-as receives a total of 1 weekly downloads. As such, esbuild-plugin-blurhash-as popularity was classified as not popular.
We found that esbuild-plugin-blurhash-as demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.