0

This is my code:

exports.generate_qr = function(value) {
  var urlQR;
  QRCode.toDataURL(value, { scale: 10, errorCorrectionLevel: 'M' }, function (err, url) {
    urlQR = url;
  });
  return urlQR;
};

Then i call with

var url = exports.generate_qr("Hello World!");
console.log(url);

But only return undefined

0 Answers0