qr code generator node js code example
Example 1: read qr code from image nodejs
var Jimp = require("jimp");
var fs = require('fs')
var qrCode = require('qrcode-reader');
var buffer = fs.readFileSync(__dirname + '/image.png');
Jimp.read(buffer, function(err, image) {
if (err) {
console.error(err);
}
let qrcode = new qrCode();
qrcode.callback = function(err, value) {
if (err) {
console.error(err);
}
console.log(value.result);
};
qrcode.decode(image.bitmap);
});
Example 2: qr code generator with javascript
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>