qr-util

1.1.0 • Public • Published

QR Utils

Simple Promise-based library to generate and read QR codes.

Example

// generate QR code image file
await QRUtil.generateImage('HELLO WORLD', 'temp.png');

// read generated image file
const imageBuffer = fs.readFileSync('temp.png');

// parse the QR code image to get the contained data
const parsedData = await QRUtil.parseQR(imageBuffer);

console.log(parsedData); // HELLO WORLD

Methods

generateDataURL(data: string): Promise<string>;
generateBase64(data: string): Promise<string>;
generateImage(data: string, imagePath: string): Promise<void>;
parseQR(qrImageDataBuffer: Buffer): Promise<string>;

Readme

Keywords

Package Sidebar

Install

npm i qr-util

Weekly Downloads

55

Version

1.1.0

License

ISC

Unpacked Size

2.08 kB

Total Files

3

Last publish

Collaborators

  • jakecyr