kjelsrud.dev/node_modules/load-yaml-file
2023-07-19 21:31:30 +02:00
..
node_modules 🎉 initiate project *astro_rewrite* 2023-07-19 21:31:30 +02:00
foo.yml 🎉 initiate project *astro_rewrite* 2023-07-19 21:31:30 +02:00
index.js 🎉 initiate project *astro_rewrite* 2023-07-19 21:31:30 +02:00
package.json 🎉 initiate project *astro_rewrite* 2023-07-19 21:31:30 +02:00
readme.md 🎉 initiate project *astro_rewrite* 2023-07-19 21:31:30 +02:00
test.js 🎉 initiate project *astro_rewrite* 2023-07-19 21:31:30 +02:00

Load YAML file

Read and parse a YAML file.

Installation

npm install --save load-yaml-file

Usage

const loadYamlFile = require('load-yaml-file')

loadYamlFile('foo.yml').then(data => {
  console.log(data)
  //=> {foo: true}
})

API

loadYamlFile(filepath)

Returns a promise for the parsed YAML.

loadYamlFile.sync(filepath)

Returns the parsed YAML.