A library for generating and decoding QR codes
$ npm install @adobe/helix-qr-code
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.
$ npm install
$ npm test
$ npm run lint