Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blurhash-base64

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blurhash-base64

Utility to convert blurhash to base64

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
215
decreased by-15.35%
Maintainers
1
Weekly downloads
 
Created
Source

Blurhash to Base64

:unicorn: Turn blurhash to dataURL on the go.

Test Downloads this Week Bundle Size Version

Blurhash to DataURL

:package: Requirements

  • Node.js 16X LTS or Higher 📦

:sparkles: Installation

  • Install the NPM Package with the below command:
#npm
npm install blurhash-base64

#yarn
yarn add blurhash-base64

#pnpm
pnpm add blurhash-base64

:bulb: Usage Example for next/image component

  • Import blurhashToBase64 in your project
  • Set the placeholder prop to blur
  • And pass the blurhash to blurDataURL prop surrounded by blurhashToBase64 (See below example)
import Image from "next/image";
import { blurhashToBase64 } from "blurhash-base64"; // Import blurhashToBase64

export default function Home() {
  return (
    <div>
      <Image
        src="https://picsum.photos/200/300"
        width={200}
        height={300}
        placeholder="blur"
        blurDataURL={blurhashToBase64("UNFFyr-4VXtm%~Z~VXpJpdngnMtl_Ns7VrXA")}
      />
    </div>
  );
}

:ballot_box_with_check: Demo

Blurhash to DataURL

:six_pointed_star: Credits

  • Blurhash is Generated with blurhash-from-url - A library to generate the blurhash from the given URL.
  • Blurhash CLI - Generate Blurhash in CLI
:green_heart: Message

I hope you find this useful. If you have any questions, please create an issue.

Keywords

FAQs

Package last updated on 14 Sep 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc