📇 QR Code

Generate QR codes in Deno, as base64-encoded images, completely dependency-free and requires no binary.

This is a port of zenozeng/node-yaqrcode, which itself is a port of the QR code generator in the d-project.

Test CI

import { qrcode } from "https://raw.githubusercontent.com/denorg/qrcode/master/mod.ts";
const base64Image = qrcode("bitcoin:ADDRESS?amount=0.5&label=ORDER"); // data:image/gif;base64,...

QR code

You can also add a custom size by specifying size in the second parameter:

const fixedSizeImage = qrcode("bitcoin:ADDRESS?amount=0.5&label=ORDER", { size: 500 });

Alternatively, you can use it directly from the CLI:

deno run https://raw.githubusercontent.com/denorg/qrcode/master/cli.ts <text>

You can also install it globally using the following:

deno install qrcode https://raw.githubusercontent.com/denorg/qrcode/master/cli.ts

Then, the package is available to run:

qrcode <text>

👩‍💻 Development

Run tests:

deno test

Notes

📄 License