qrcodegener

1.0.1 • Public • Published

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}`));

Readme

Keywords

Package Sidebar

Install

npm i qrcodegener

Weekly Downloads

3

Version

1.0.1

License

MIT

Unpacked Size

2.66 kB

Total Files

3

Last publish

Collaborators

  • eesolution