lib/config.js
function readYaml(filePath) {
    return new Promise((resolve, reject) => {
        if (!filePath || typeof filePath !== 'string') {
            throw new Error('Path must be a string');
        }
        fs.readFile(filePath, (err, data) => {
            if (err) {
                return reject(err);
            }
            // Remove UTF-8 BOM if present
            if (data.length >= 3 && data[0] === 0xef &&
                data[1] === 0xbb && data[2] === 0xbf) {
                data = data.slice(3);
            }
            try {
                return resolve(yaml.safeLoad(data));
            } catch (yamlerr) {
                return reject(yamlerr);
            }
        });
    });
}
function readYaml(filePath) {
    return new Promise((resolve, reject) => {
        if (!filePath || typeof filePath !== 'string') {
            throw new Error('Path must be a string');
        }
        fs.readFile(filePath, (err, data) => {
            if (err) {
                return reject(err);
            }
            // Remove UTF-8 BOM if present
            if (data.length >= 3 && data[0] === 0xef &&
                data[1] === 0xbb && data[2] === 0xbf) {
                data = data.slice(3);
            }
            try {
                return resolve(yaml.safeLoad(data));
            } catch (yamlerr) {
                return reject(yamlerr);
            }
        });
    });
}
function readYaml ( filePath ) { return new Promise ( ( resolve , reject ) => { if ( ! filePath || typeof filePath !== 'string' ) { throw new Error ( 'Path must be a string' ) ; } fs . readFile ( filePath , ( err , data ) => { if ( err ) { return reject ( err ) ; } // Remove UTF-8 BOM if present if ( data . length >= 3 && data [ 0 ] === 0xef && data [ 1 ] === 0xbb && data [ 2 ] === 0xbf ) { data = data . slice ( 3 ) ; } try { return resolve ( yaml . safeLoad ( data ) ) ; } catch ( yamlerr ) { return reject ( yamlerr ) ; } } ) ; } ) ; }
Read and parse configuration file from disc

@param {string} filePath Path of file to read
@param {configComplete} callback Completion callback
@returns {Promise<*>} Resolves tyo YAML parsed configuration file
Read and parse configuration file from disc