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

qrcode-pro

v1.0.1

Published

A powerful QR code generator with weird and incredible features - custom styling, gradients, logos, animations, and more!

Downloads

19

Readme

QRCode Pro 🎨

A powerful and feature-rich QR code generator with weird and incredible features! Create stunning, customizable QR codes with gradients, logos, animations, custom shapes, and much more.

Features ✨

Basic Features

  • ✅ Standard QR code generation
  • ✅ Customizable colors (dark/light)
  • ✅ Adjustable size and margins
  • ✅ Error correction levels (L, M, Q, H)

Weird & Incredible Features 🚀

  • 🎨 Gradient Support - Linear and radial gradients
  • 🖼️ Logo Embedding - Add your logo in the center
  • 🎭 Custom Dot Shapes - Square, rounded, circle, diamond, star
  • 🔲 Custom Corner Styles - Extra-rounded corners, dots, circles
  • 🖼️ Background Images - Add background images with transparency
  • 🎨 Pattern Overlays - Dots, lines, grid, waves
  • 🖼️ Frames - Solid, dashed, or dotted borders
  • Animations - Pulse, rotate, wave, glow effects
  • 🔄 Rounded Corners - Modern rounded corner styling

Installation

npm install qrcode-pro

Note: This package requires a browser environment (uses document.createElement for canvas). For Node.js environments, consider using node-canvas or similar alternatives.

Usage

Basic Usage

import { generateQRCode } from "qrcode-pro";

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
});

// Use the generated QR code
const img = document.createElement("img");
img.src = qrCode.dataURL;
document.body.appendChild(img);

With Gradient

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  gradient: {
    type: "linear",
    rotation: 45,
    stops: [
      { offset: 0, color: "#FF6B6B" },
      { offset: 1, color: "#4ECDC4" },
    ],
  },
});

With Logo

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  logo: {
    src: "https://example.com/logo.png",
    width: 0.2, // 20% of QR code size
    margin: 0.1,
  },
});

Custom Dot Shapes

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  dotType: "circle", // or 'rounded', 'diamond', 'star'
  cornerSquareType: "extra-rounded",
  cornerDotType: "circle",
});

With Background Image

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  backgroundImage: "https://example.com/bg.jpg",
  backgroundAlpha: 0.3,
});

With Pattern Overlay

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  pattern: {
    enabled: true,
    type: "waves", // or 'dots', 'lines', 'grid'
    color: "#000000",
    opacity: 0.1,
  },
});

With Frame

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  frame: {
    enabled: true,
    width: 3,
    color: "#FF6B6B",
    style: "dashed", // or 'solid', 'dotted'
  },
});

With Animation

import { generateQRCode, applyAnimation } from "qrcode-pro";

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  animation: {
    enabled: true,
    type: "pulse", // or 'rotate', 'wave', 'glow'
    speed: 1000,
  },
});

if (qrCode.canvas) {
  const stopAnimation = applyAnimation(qrCode.canvas, "pulse", 1000);
  // Call stopAnimation() to stop the animation
}

Rounded Corners

const qrCode = await generateQRCode({
  text: "https://example.com",
  width: 300,
  roundedCorners: true,
  cornerRadius: 20,
});

React Example

import React, { useEffect, useState } from "react";
import { generateQRCode, QRCodeResult } from "qrcode-pro";

function QRCodeComponent() {
  const [qrCode, setQrCode] = useState<QRCodeResult | null>(null);

  useEffect(() => {
    generateQRCode({
      text: "https://example.com",
      width: 300,
      gradient: {
        type: "linear",
        rotation: 45,
        stops: [
          { offset: 0, color: "#FF6B6B" },
          { offset: 1, color: "#4ECDC4" },
        ],
      },
      logo: {
        src: "/logo.png",
        width: 0.2,
      },
      dotType: "circle",
    }).then(setQrCode);
  }, []);

  if (!qrCode) return <div>Loading...</div>;

  return <img src={qrCode.dataURL} alt="QR Code" />;
}

API Reference

generateQRCode(options: QRCodeOptions): Promise<QRCodeResult>

Generates a QR code with the specified options.

Options

| Option | Type | Default | Description | | ---------------------- | ---------------------------------------------------------- | --------------------------------------- | --------------------------------- | | text | string | required | The text/URL to encode | | width | number | 300 | Width of the QR code in pixels | | margin | number | 4 | Margin around the QR code | | errorCorrectionLevel | 'L' \| 'M' \| 'Q' \| 'H' | 'M' | Error correction level | | color | { dark?: string, light?: string } | { dark: '#000000', light: '#FFFFFF' } | Colors for dark and light modules | | gradient | GradientConfig | - | Gradient configuration | | logo | LogoConfig | - | Logo configuration | | dotType | 'square' \| 'rounded' \| 'circle' \| 'diamond' \| 'star' | 'square' | Shape of QR code dots | | cornerSquareType | 'square' \| 'extra-rounded' \| 'dot' | 'square' | Style of corner squares | | cornerDotType | 'square' \| 'dot' \| 'circle' | 'square' | Style of corner dots | | backgroundImage | string | - | Background image URL or data URL | | backgroundAlpha | number | 0.3 | Background image opacity (0-1) | | frame | FrameConfig | - | Frame configuration | | pattern | PatternConfig | - | Pattern overlay configuration | | roundedCorners | boolean | false | Enable rounded corners | | cornerRadius | number | 10 | Corner radius in pixels |

Return Value

{
  dataURL: string; // Data URL of the QR code image
  svg: string; // SVG string representation
  canvas: HTMLCanvasElement | null; // Canvas element
}

applyAnimation(canvas: HTMLCanvasElement, type: AnimationType, speed?: number): () => void

Applies an animation to a canvas element. Returns a function to stop the animation.

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.