code: function checkFileExists(filename, callback) {
    if (fs.exists !== undefined) {
      fs.exists(filename, callback);
    } else {
      fs.stat(filename, function (err) {
        callback(!err);
      });
    }
  }
docs: /* Older versions of node do not have fs.exists so we implement our own