qrcode-gen-custom
v2.3.0
Published
This library will help you to generate qr code using a link
Downloads
23
Maintainers
Readme
Custom QR Code Generator
Generate QR codes easily with this simple QR code generator library for JavaScript.
Installation
Install the library using npm:
npm install qrcode-gen-custom
Usage
Import the library const generateQRCode = require('qrcode-gen-custom');
Define the link you want to generate a QR code for const link = 'https://example.com';
Generate the QR code URL const qrCodeURL = generateQRCode(link);
Use the generated QR code URL as needed console.log('QR Code URL:', qrCodeURL);
API
generateQRCode(link: string): string
Generates a QR code URL for the given link.
link
(string): The URL or text for which the QR code will be generated.
Returns a string representing the QR code URL
Example in React
Assuming you have the library installed, here's how you can use it in a React functional component:
import React from 'react';
import generateQRCode from 'qrcode-gen-custom';
const MyComponent = () => {
const link = 'https://example.com';
const qrCodeURL = generateQRCode(link);
return (
<div>
<h1>QR Code Generator</h1>
<img src={qrCodeURL} alt="QR Code" />
</div>
);
};
export default MyComponent;
Contributing
Feel free to contribute to this project by opening issues or creating pull requests.
License
This project is licensed under the MIT License - see the LICENSE file for details
Author
Abhijeet Tyagi