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

@useqr/core

v1.0.1

Published

UseQR core engine: QR matrix, styled SVG renderer, typed payload builders, decode-verify loop. MIT, zero-tracking, works in browser and Node.

Readme

@useqr/core

The engine behind UseQR: QR matrix generation, a styled SVG renderer, 30+ typed payload builders, and a decode-verify loop that proves a design still scans.

MIT. Two runtime dependencies. No network calls, no telemetry, no account. Works in browsers, Node 18+, Bun, Deno, and edge runtimes.

npm i @useqr/core

Generate

import { generateSvg } from "@useqr/core";

const { svg } = generateSvg({
  data: "https://example.com",
  moduleStyle: "rounded",
  eyeFrameStyle: "leaf",
  foreground: {
    type: "linear",
    rotation: 45,
    stops: [
      { offset: 0, color: "#312e81" },
      { offset: 1, color: "#1e3a8a" },
    ],
  },
  label: { text: "SCAN ME" },
});

Eight module shapes, five eye styles (with per-corner overrides), solid/linear/radial paints, logo embedding with automatic error-correction bump, labels, and transparent backgrounds.

Typed payloads

Builders escape and validate for you, and throw a PayloadError carrying a fix string you can show a user — or hand to an agent — verbatim.

import { buildWifi, buildUpi, PayloadError } from "@useqr/core";

buildWifi({ ssid: "CafeGuest", password: "espresso", security: "WPA" });
// "WIFI:T:WPA;S:CafeGuest;P:espresso;;"

try {
  buildUpi({ vpa: "not-an-id", payeeName: "Shop" });
} catch (error) {
  if (error instanceof PayloadError) console.log(error.field, error.fix);
}

URL · text · email · phone · SMS · WiFi · vCard · MeCard · WhatsApp · Telegram · social hub · calendar event · geo · app download · UPI · PayPal · Bitcoin · Litecoin · Bitcoin Cash · Dogecoin · Dash · any BIP-21 chain · Ethereum · PIX · EPC/SEPA · Google review · menu · feedback · coupon · PDF link · JSON · Base64 · SSH/Git — plus applyUtm for campaign-tagged links.

Verify that it actually scans

The verify loop renders, rasterizes, and decodes with a real decoder (zxing), then compares against your input. Rasterization is injected because it differs per environment:

import { verifyQr } from "@useqr/core";
import { Resvg } from "@resvg/resvg-js";

const report = await verifyQr(
  { data: "hello", renderOptions: { foreground: "#cccccc" } },
  (svg, width) =>
    new Uint8Array(new Resvg(svg, { fitTo: { mode: "width", value: width } }).render().asPng()),
);
// { scannable, decoded, matchesInput, version, ecLevel, contrast, issues }

In a browser, pass a canvas-based rasterizer instead. zxing-wasm is imported dynamically inside verifyQr, so applications that only generate never download the wasm.

Print and cutting output

generateSvg({ data: "https://example.com", profile: "tiny" });

profile: "tiny" emits SVG Tiny 1.2 — no clip paths, no ARIA attributes, no properties outside the Tiny set — which is what Illustrator, print-shop RIPs, and cutting software expect.

Notes

  • ESM only. From CommonJS, use await import("@useqr/core").
  • Semver contract. Everything exported from the package root is public API; breaking changes to it mean a major version. Internal modules are not importable by subpath.
  • Rendering is deterministic — the same input always produces byte-identical SVG, which is what lets UseQR's hosted API cache forever.

Related