Skip to main content

Built and signed on GitHub Actions

Auditable, 0-dependency, cross-platform QR Code Pattern encoder & decoder.

This package works with Node.js, Deno, Bun, BrowsersIt is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
88%
Published
4 days ago (0.4.2)

Methods for encoding (generating) QR code patterns. Check out decode.ts for decoding (reading).

Examples

Example 1

import encodeQR from '@paulmillr/qr';
const txt = 'Hello world';
const ascii = encodeQR(txt, 'ascii'); // Not all fonts are supported
const terminalFriendly = encodeQR(txt, 'term'); // 2x larger, all fonts are OK
const gifBytes = encodeQR(txt, 'gif'); // Uncompressed GIF
const svgElement = encodeQR(txt, 'svg'); // SVG vector image element
const array = encodeQR(txt, 'raw'); // 2d array for canvas or other libs
// import decodeQR from '@paulmillr/qr/decode';
Built and signed on
GitHub Actions

Add Package

deno add jsr:@paulmillr/qr

Import symbol

import * as qr from "@paulmillr/qr";
or

Import directly with a jsr specifier

import * as qr from "jsr:@paulmillr/qr";

Add Package

pnpm i jsr:@paulmillr/qr
or (using pnpm 10.8 or older)
pnpm dlx jsr add @paulmillr/qr

Import symbol

import * as qr from "@paulmillr/qr";

Add Package

yarn add jsr:@paulmillr/qr
or (using Yarn 4.8 or older)
yarn dlx jsr add @paulmillr/qr

Import symbol

import * as qr from "@paulmillr/qr";

Add Package

npx jsr add @paulmillr/qr

Import symbol

import * as qr from "@paulmillr/qr";

Add Package

bunx jsr add @paulmillr/qr

Import symbol

import * as qr from "@paulmillr/qr";