JSPM

qr-auto-logo

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15463F
  • License MIT

Create QR Code with logo and validaton

Package Exports

  • qr-auto-logo
  • qr-auto-logo/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (qr-auto-logo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

qr-auto-logo

Create QR-Code with logo and validaton.

qrlogo is an all in one function, to generate a QR-Code, scale it with an multiplier, insert a logo, check if it's still valid and if not, resize the logo down until it becomes valid.

Installation

To install qrlogo and all of its dependencies run:

npm install --save qr-auto-logo

Usage:

Basic usage to generate QR-Codes:

const qrlogo = require('qr-auto-logo');
const qrcode = await qrlogo('https://google.com');

All parameters except data are optional.

Logos can be added via passing second parameter as string or buffer.

const qrcode = await qrlogo('https://google.com', 'logo.png');

Third parameter scales the QR-Code up. This can be used, to get more space for a smooth logo inside the QR-Code.

With logoScale parameter you may define the starting coefficient of the logo size. This defaults to 0.4 (40%). Coefficients bigger than 0.5 are not recommended.

However if the coefficient is to big and the QR-Code renders not readable, qrlogo will scale down the coefficient with steps of 0.05 until it can be read. If you would like to turn off autoscale, you can pass false as fifth parameter.

The QR-Code is then returned as buffer.

License

MIT License. Copyright (c) 2021 Daniel Elstner