JSPM

load-yaml-file

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1999590
  • Score
    100M100P100Q195167F
  • License MIT

Package Exports

  • load-yaml-file

Readme

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