Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

read-yaml-file

zkochan13mMIT2.1.0TypeScript support: included

Read and parse a YAML file

yaml, read

readme

read-yaml-file

Read and parse a YAML file

npm version

Installation

<npm|yarn|pnpm> add read-yaml-file

Usage

const readYamlFile = require('read-yaml-file')

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

API

readYamlFile(filepath)

Returns a promise for the parsed YAML.

readYamlFile.sync(filepath)

Returns the parsed YAML.

License

MIT © Zoltan Kochan


This package was forked from load-yaml-file

changelog

read-yaml-file

2.1.0

Minor Changes

  • bba9985: graceful-fs and mz removed from dependencies.

2.0.1

Patch Changes

  • 68010ea: Use util.promisify instead of the pify library.
  • 5f01634: Update js-yaml to version 4.