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

hugo-qr

v0.1.0

Published

QR codes for apps: a dependency-free encoder (all 40 versions, L/M/Q/H), droplet-style shapes with room for a logo, SVG output and one link format for sign-in, sharing and joining. Runs on servers, edge workers and in React Native

Readme

hugo-qr

QR codes for apps. A dependency-free encoder, droplet-style shapes that are cheap to draw anywhere, SVG output, and one link format for signing in, sharing and joining. The same code runs on a Node server, an edge worker, in the browser and in React Native.

| Piece | What it does | |---|---| | Encoder | Byte mode (UTF-8), versions 1–40, error correction L/M/Q/H, Reed–Solomon, mask chosen by the standard penalty score | | Shapes | The three finder "eyes" plus horizontal runs of dark modules, with an optional cleared square for a logo | | SVG | A ready-to-serve image with rounded runs and a two-colour gradient | | Links | <base>/q/<kind>/<value>: a phone camera opens it in the browser, your own scanner acts on it directly |

npm install hugo-qr

Encode

import { encodeQr } from 'hugo-qr';

const qr = encodeQr('https://music.example/q/room/station-1'); // level Q by default
qr.version; // 4 — the smallest that fits
qr.size; // 33 modules per side
qr.modules[y][x]; // true = dark

Pass { ecc: 'H' } for the most error correction, { minVersion } to keep a fixed size across codes, { mask } to force a mask pattern.

Draw

qrShapes turns the matrix into a few hundred shapes instead of one per module, so a React Native view stays light:

import { encodeQr, qrShapes } from 'hugo-qr';

const { size, eyes, runs, logo } = qrShapes(encodeQr(link), { logo: 0.2 });
const m = 240 / size; // points per module
runs.map((r) => <View key={`${r.x},${r.y}`} style={{ position: 'absolute', left: r.x * m, top: r.y * m, width: r.len * m, height: m, borderRadius: m / 2 }} />);

Keep logo at or under about 0.22 with level Q or H: error correction rebuilds the modules the logo covers.

import { encodeQr, toSvg } from 'hugo-qr';

res.type('image/svg+xml').send(toSvg(encodeQr(link), { colors: ['#7CE3A4', '#4AA3F5'] }));

Links

import { qrLink, parseQrLink } from 'hugo-qr';

qrLink('https://music.example', 'login', 'k3J9…'); // "https://music.example/q/login/k3J9…"
parseQrLink(scannedText); // { kind: 'login', value: 'k3J9…' } or null

Any address is accepted when reading, including development links such as exp://…/--/q/login/…. Only the kind and value are used, and only against your own server, so a code made elsewhere can at most point at something your server already knows.

Tests

npm test checks exact matrices for known inputs (recorded after a module-by-module comparison with an independent encoder), the fixed patterns every reader looks for, version limits, shapes and links, then builds the type declarations.

License

MIT