How to use the loadYaml function from cosmiconfig

Find comprehensive JavaScript cosmiconfig.loadYaml code examples handpicked from public code repositorys.

29
30
31
32
33
34
35
36
37
38
  '.yml': cosmiconfig.loadYaml,
  '.js': cosmiconfig.loadJs,
  '.ts': {
    async: TypeScriptLoader,
  },
  noExt: cosmiconfig.loadYaml
}

export const getConfig = async (path?: string) => {
  const configPath = path && parse(resolve(path)).dir
fork icon52
star icon0
watch icon0

93
94
95
96
97
98
99
100
101
102
function loadJson(filepath, content) {
    return cosmiconfig.loadJson(filepath, stripBom(stripJsonComments(content)));
}

function loadYaml(filepath, content) {
    return cosmiconfig.loadYaml(filepath, stripBom(content));
}

const explorer = cosmiconfig(MODULE_NAME, {
    cache: false,
fork icon0
star icon0
watch icon0