{"size": 322, "ext": "js", "max_stars_repo_path": "compareImages.js", "max_stars_repo_name": "FayazK/Resemble.js", "max_stars_repo_stars_event_min_datetime": "2017-11-27T03:23:01.000Z", "max_stars_repo_stars_event_max_datetime": "2017-11-27T03:23:01.000Z", "max_issues_repo_path": "web/themes/custom/fldrupalcamp2018/node_modules/resemblejs/compareImages.js", "max_issues_repo_name": "grshane/macchiato-relativity-composer", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "web/themes/custom/fldrupalcamp2018/node_modules/resemblejs/compareImages.js", "max_forks_repo_name": "grshane/macchiato-relativity-composer", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.0, "max_line_length": 66, "alphanum_fraction": 0.6055900621}
const resemble = require('./resemble');

module.exports = async function(image1, image2) {
  return new Promise(function(resolve, reject) {
    resemble(image1).compareTo(image2).onComplete(function(data) {
      if (data.error) {
        reject(data.error);
      } else {
        resolve(data);
      }
    });
  });
};
