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

coolqr

v2.1.0

Published

This is a custom QR code generator.

Readme

CoolQR

CoolQR is a browser-side TypeScript library for rendering customizable QR codes with Konva. It supports styled finder eyes, multiple dot shapes, solid or gradient fills, and optional center images. Use it in browser applications or browser-targeted bundles; Node canvas rendering is outside the supported runtime.

Demo

Live demo

Installation

npm install coolqr

Usage

import CoolQR, { type QROptions } from 'coolqr'

const options = {
	size: 512,
	background: {
		fill: {
			type: 'solid',
			color: '#ffffff',
		},
	},
	eyes: {
		outer: {
			shape: 'rounded',
			fill: {
				type: 'solid',
				color: '#111827',
			},
		},
		inner: {
			shape: 'circle',
			fill: {
				type: 'solid',
				color: '#111827',
			},
		},
	},
	dots: {
		shape: 'diamond',
		fill: {
			type: 'gradient',
			color: '#111827',
			gradient: {
				type: 'linear',
				colors: ['#ef4444', '#2563eb'],
			},
		},
	},
	image: {
		src: '/logo.png',
		margin: 12,
		hideDots: true,
	},
} satisfies QROptions

const container = document.getElementById('qr-container') as HTMLDivElement
const stage = await CoolQR.draw('https://example.com', container, options)

size is the exact width and height of the generated canvas in pixels. All modules and decorative geometry scale proportionally. When an optional image cannot load, CoolQR renders the QR code without the image and keeps the underlying dots visible.

Destroy a stage when replacing it or unmounting its container:

stage.destroy()

API

CoolQR.draw(data, container, options)

Renders the supplied data and resolves with a Konva.Stage.

  • data: String encoded into the QR code.
  • container: Browser HTMLDivElement that owns the stage.
  • options: A QROptions object.

The named draw export is also available.

QROptions

  • size: Positive output width and height in pixels.
  • background.fill: Canvas fill.
  • eyes.outer.shape: square, circle, rounded, rounded2, rounded3, rounded4, rounded5, rounded6, or squarecircle.
  • eyes.inner.shape and dots.shape: square, circle, diamond, rounded, rounded2, rounded3, rounded4, sun, cross, hexagon, or octagon.
  • image.src: Optional same-origin or CORS-enabled image URL.
  • image.margin: Non-negative image inset in pixels.
  • image.hideDots: Removes covered modules only after the image loads successfully.

Fill

Solid fill:

const fill = {
	type: 'solid',
	color: '#111827',
} satisfies Fill

Gradient fill:

const fill = {
	type: 'gradient',
	color: '#111827',
	gradient: {
		type: 'radial',
		colors: ['#f43f5e', '#8b5cf6', '#2563eb'],
	},
} satisfies Fill

Gradient colors are distributed evenly and require at least two entries. color remains the fallback color for consumers that transform options before rendering.

Development

pnpm install
pnpm verify

cd demo
pnpm install
pnpm verify

pnpm verify runs linting, runtime tests, consumer declaration tests, and builds.

Docker Deployment

The production demo runs as an unprivileged, read-only container. Compose binds the application only to loopback on port 9491, allowing the host's Nginx service to continue handling TLS.

docker compose build
docker compose up -d
docker compose ps
curl --fail http://127.0.0.1:9491/

Use COOLQR_PORT to select a different loopback port for validation:

COOLQR_PORT=9492 docker compose -p coolqr-staging up -d --build

Release

pnpm verify
npm pack --dry-run
npm run release

prepack always rebuilds the package, and prepublishOnly runs the full verification suite without recursively invoking npm publish.

License

ISC