Read and parse a YAML file.
npm install --save load-yaml-file
import { loadYamlFile } from 'load-yaml-file'
const data = await loadYamlFile('foo.yml')
console.log(data)
//=> {foo: true}
import { loadYamlFileSync } from 'load-yaml-file'
const data = loadYamlFileSync('foo.yml')
console.log(data)
//=> {foo: true}
loadYamlFile(path)
path
(string | Buffer | URL
, required)Promise<unknown>
- a promise for the parsed YAMLloadYamlFileSync(path)
path
(string | Buffer | URL
, required)unknown
- the parsed YAML