Package Exports
- qrcodegener
- qrcodegener/src/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 (qrcodegener) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
qr-code-generator
QR Code Generator Package for JavaScript
This package provides a simple QR code generator in JavaScript using the qrcode library.
Installation
Before using the package, make sure to install the required dependencies:
npm install qrcode
# usage
const QRCodeGenerator = require('qr-code-generator');
// Example Usage:
const dataToEncode = 'https://www.example.com';
const outputImagePath = 'example-qrcode.png';
const options = { type: 'png', errorCorrectionLevel: 'H', width: 300, margin: 2 };
QRCodeGenerator.generate(dataToEncode, outputImagePath, options)
.then((imagePath) => console.log(`QR code generated and saved at: ${imagePath}`))
.catch((error) => console.error(`Error generating QR code: ${error.message}`));