Example #1
0
 }, function (contents, next) {
   try {
     next(null, normalize.stripBOM(contents));
   } catch (err) {
     err.message = 'Failed to read "' + filepath + '": ' + err.message;
     next(err);
   }
 }
Example #2
0
file.readFileSync = function(filepath, enc) {
  enc = enc || 'utf8';
  var buffer = fs.readFileSync(String(filepath), enc);
  try {
    return normalize.stripBOM(buffer);
  } catch (err) {
    err.message = 'Failed to read "' + filepath + '": ' + err.message;
    throw err;
  }
};