{"size": 499, "ext": "js", "max_stars_repo_path": "src/utilities/qr.js", "max_stars_repo_name": "cristiandev19/inmobiliariahomebeauty-back", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utilities/qr.js", "max_issues_repo_name": "cristiandev19/inmobiliariahomebeauty-back", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/utilities/qr.js", "max_forks_repo_name": "cristiandev19/inmobiliariahomebeauty-back", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.6818181818, "max_line_length": 55, "alphanum_fraction": 0.5751503006}
const imagesUtilities = require('../utilities/images');
const QRCode = require('easyqrcodejs-nodejs');

exports.generateQRByUrl = (url) => {
  return new Promise(async (resolve) => {
    try {
      // Options
      const options = {
        text: url
      };
      // New instance with options
      const qrcode = new QRCode(options);
      const dataQR = await qrcode.toDataURL()

      return resolve({
        dataQR
      })
    } catch (error) {
      return resolve({ error });
    }
  })
}