load-yaml-file
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Load YAML file

Read and parse a YAML file.

Installation

npm install --save load-yaml-file

Usage

import { loadYamlFile } from 'load-yaml-file'

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

Sync

import { loadYamlFileSync } from 'load-yaml-file'

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

API

loadYamlFile(path)

  • path (string | Buffer | URL, required)
  • returns Promise<unknown> - a promise for the parsed YAML

loadYamlFileSync(path)

  • path (string | Buffer | URL, required)
  • returns unknown - the parsed YAML

Related

/load-yaml-file/

    Package Sidebar

    Install

    npm i load-yaml-file

    Weekly Downloads

    1,624,799

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.97 kB

    Total Files

    8

    Last publish

    Collaborators

    • linusu