Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @manufosela/qr-code-generator with all npm packages installed. Try it out:

var qrCodeGenerator = require("@manufosela/qr-code-generator")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@manufosela/qr-code-generator v1.0.1

qr code generatori based in qrcode-generator by Kazuhiko Arase. Refactor to ES6 classes

QRCode Generator

QRCodeGenerator ES6 class.

Use

const qr = new QRCodeGenerator(typeNumber, errorCorrectLevel);

Where:

  • typeNumber: from 1 to 10

    • qrcode size: 1 to max 14 characters with Low errorCorrectLevel
    • qrcode size: 10 to max 213 characters with Low errorCorrectLevel
  • errorCorrectLevel: it can be:

    • L (Low) => ~7%
    • M (Medium) => ~15%
    • Q (Quartile) => ~25%
    • H (High) => ~30%

Example

  const qr = new QRCodeGenerator(4, 'M');
  const text = "https://manufosela.es";
  qr.addData(text);
  qr.make();
  qrcodeHTML = qr.createImgTag();

  document.querySelector('#qr').innerHTML = qrcodeHTML;

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free