File size: 256 Bytes
aa2e6af
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const fs = require('fs');
const yaml = require('js-yaml');

function loadYaml(filepath) {
  try {
    let fileContents = fs.readFileSync(filepath, 'utf8');
    return yaml.load(fileContents);
  } catch (e) {
    return e;
  }
}

module.exports = loadYaml;