@liquid-js/qrcode-generator
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

QR Code Generator

Version

JavaScript library for generating QR codes.

Installation

npm install @liquid-js/qrcode-generator

API Documentation

https://liquid-js.github.io/qrcode-generator/

Usage

Browser

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>QR Code Generator</title>
  </head>
  <body>
    <div id="placeHolder"></div>
    <script type="module">
      import { QRCode } from "https://unpkg.com/@liquid-js/qrcode-generator/lib/qr-code.js";

      const typeNumber = 4;
      const errorCorrectionLevel = "L";
      const qr = new QRCode(typeNumber, errorCorrectionLevel);
      qr.addData("Hi!");
      qr.make();
      document.getElementById("placeHolder").innerHTML = qr.createImgTag();
    </script>
  </body>
</html>

Node

import { QRCode } from "@liquid-js/qrcode-generator";

const typeNumber = 4;
const errorCorrectionLevel = "L";
const qr = new QRCode(typeNumber, errorCorrectionLevel);
qr.addData("Hi!");
qr.make();

console.log(qr.createASCII());

License

MIT License


This implementation is based on JIS X 0510:1999.

The word 'QR Code' is registered trademark of DENSO WAVE INCORPORATED
http://www.denso-wave.com/qrcode/faqpatent-e.html

Readme

Keywords

Package Sidebar

Install

npm i @liquid-js/qrcode-generator

Weekly Downloads

50

Version

1.0.1

License

MIT

Unpacked Size

207 kB

Total Files

84

Last publish

Collaborators

  • hitko