1.0.0 • Published 2 months ago

my-qrcode-generator v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

QR Code Generator

A simple QR Code Generator written in JavaScript.

Installation

You can install this package via npm:

npm install my-qrcode-generator

Usage

const generateQRCode = require('my-qrcode-generator');

generateQRCode("https://example.com").then((url) => {
    console.log(url);
}).catch((err) => {
    console.error(err);
});

API

generateQRCode(text, options)

Generates a QR Code for the provided text.

  • text: The text to encode into the QR Code.
  • options (optional): An object containing options for customizing the QR Code generation (e.g., size, error correction level).

Returns a Promise that resolves with the data URL of the generated QR Code image.

Example

Generate a QR Code for a website URL:

generateQRCode("https://example.com").then((url) => {
    console.log(url);
}).catch((err) => {
    console.error(err);
});

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.0.0

2 months ago