Read and parse a YAML file.
npm install load-yaml-fileRead and parse a YAML file.
``sh`
npm install --save load-yaml-file
`js
import { loadYamlFile } from 'load-yaml-file'
const data = await loadYamlFile('foo.yml')
console.log(data)
//=> {foo: true}
`
`js
import { loadYamlFileSync } from 'load-yaml-file'
const data = loadYamlFileSync('foo.yml')
console.log(data)
//=> {foo: true}
`
- path (string | Buffer | URL, required)Promise
- returns - a promise for the parsed YAML
- path (string | Buffer | URL, required)unknown` - the parsed YAML
- returns
- write-yaml-file - Stringify and write YAML to a file atomically
- load-json-file - Read and parse a JSON file