Skip to main content
Home

Built and signed on GitHub Actions

🔳 SVG-based QRcode generator

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
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
100%
Published
6 months ago (2.0.1)

🔳 QR Code generator

JSR JSR Score NPM Coverage

📑 Examples

SVG output

import { qrcode } from "./mod.ts"
const svg = qrcode("https://example.com", { output: "svg" })
console.assert(svg.includes("</svg>"))

Console output

import { qrcode } from "./mod.ts"
qrcode("https://example.com", { output: "console" })

Array output

import { qrcode } from "./mod.ts"
const array = qrcode("https://example.com")
console.assert(Array.isArray(array))

✨ Features

  • Support for array, console and svg outputs out-of-the-box.
  • Support for custom colors and error correction level (ECL).
  • Has a modern implementation using TypeScript and EcmaScript modules.
  • Has no external dependencies (not even the DOM's <canvas> element)!
  • Is runtime agnostic (and even works in browsers)!

📜 License and credits

Copyright (c) Simon Lecoq <@lowlighter>. (MIT License)
https://github.com/lowlighter/libs/blob/main/LICENSE

Copyright (c) Project Nayuki. (MIT License)
https://www.nayuki.io/page/qr-code-generator-library

This library is based on the awesome work of @nayiki.

Please take a look at their articles about QR Codes:

Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@libs/qrcode

Import symbol

import * as qrcode from "@libs/qrcode";
or

Import directly with a jsr specifier

import * as qrcode from "jsr:@libs/qrcode";

Add Package

pnpm i jsr:@libs/qrcode
or (using pnpm 10.8 or older)
pnpm dlx jsr add @libs/qrcode

Import symbol

import * as qrcode from "@libs/qrcode";

Add Package

yarn add jsr:@libs/qrcode
or (using Yarn 4.8 or older)
yarn dlx jsr add @libs/qrcode

Import symbol

import * as qrcode from "@libs/qrcode";

Add Package

npx jsr add @libs/qrcode

Import symbol

import * as qrcode from "@libs/qrcode";

Add Package

bunx jsr add @libs/qrcode

Import symbol

import * as qrcode from "@libs/qrcode";