code: function lookupFile(file, opts) {
    opts = opts || {};
    var data,
      platform = opts.platform || process.platform,
      baseDir = file.match(/^\//) ? p.dirname(file) : process.cwd(),
      homeDir = process.env[(platform === 'win32') ? 'USERPROFILE' : 'HOME'],
      files = _.map([ baseDir, homeDir ], function (dir) {
        return p.join(dir, file.match(/^\//) ? p.basename(file) : file);
      });
  
    for (var i = 0, ln = files.length; i < ln; i += 1) {
      try {
        data = fs.readFileSync(files[i]);
        break;
      } catch (err) {
      }
    }
  
    if (data) {
      return data;
    } else {
      throw new Error('Unable to lookup file in ' + files.join(', '));
    }
  }
docs: Synchronously read file based on these rules:
  - if path is absolute, then check file at absolute path first
  - if path is relative, then check file at current working directory
  - if none of the above exists, check file at user home directory
  - if none exists, throw an error
  This allows simple file lookup which allows various locations.
  
  @param {String} file: the file name to read
  @param {Object} opts: optional
  - platform: needed for unit tests to override platform since node v0.11.x
  https://github.com/trevnorris/node/commit/c80f8fa8f108d8db598b260ddf26bafd2ec8a1f8
  @return {String} content of the file