code: function (cb) {
    var options = {};
    var git_commit = null;
    var git_branch = null;
  
    options.run_at = JSON.stringify(new Date()).slice(1, -1);
    options.type = "nightwatch";
    
    if (!git_commit || !git_branch) {
      if (data) {
        git_commit = git_commit || data.git_commit;
        git_branch = git_branch || data.git_branch;
      }
    }
  
    var yml = path.join(appRoot.path, '.qualitywatcher.yml');
    try {
      if (fs.statSync(yml).isFile()) {
        var qualitywatcher_yaml_conf = yaml.safeLoad(fs.readFileSync(yml, 'utf8'));
        options.repo_token = qualitywatcher_yaml_conf.repo_token;
        options.domain_name = qualitywatcher_yaml_conf.domain_name === undefined ? 'app' : qualitywatcher_yaml_conf.domain_name;
        if (qualitywatcher_yaml_conf.service_name) {
          options.service_name = qualitywatcher_yaml_conf.service_name;
        }
      }
    } catch (ex) {
      console.log("'.qualitywatcher.yml' file is missing, are you sure it is in the root of your project ?");
    }
  
    if (git_commit) {
      gitData({
        head: {
          id: git_commit
        },
        branch: git_branch
      }, function (err, git) {
        if (err) {
          console.log('error getting git data: ', err);
        } else {
          options.git = git;
        }
        return cb(err, options);
      });
    } else {
      return cb(null, options);
    }
  }
docs: Modules