1.1.2 • Published 4 years ago
@adobe/helix-qr-code v1.1.2
Helix QR Code utilities
A library for generating and decoding QR codes
Status
Installation
$ npm install @adobe/helix-qr-codeUsage
Decode a QR code from the raw image file data:
const fs = require('fs');
const qr = require('@adobe/helix-qr-code');
const bytes = fs.readFileSync('image_with_qr_code.jpg');
qr.decodeFromBuffer(bytes).then((decoded) => console.log(decoded));Encode text as a QR code (raw PNG file data output):
const fs = require('fs');
const qr = require('@adobe/helix-qr-code');
qr.encodeToBuffer('text to be encoded').then((buf) => fs.writeFileSync('qr_code.png', buf)));Encode text as a QR code (SVG output):
const qr = require('@adobe/helix-qr-code');
qr.encodeToSVG('text to be encoded').then((svg) => console.log(svg)));Encode text as a QR code (Data URL output):
const qr = require('@adobe/helix-qr-code');
qr.encodeToDataURL('text to be encoded').then((dataURL) => console.log(dataURL)));See the API documentation for more information.
Development
Build
$ npm installTest
$ npm testLint
$ npm run lint