Socket
Socket
Sign inDemoInstall

load-yaml-file

Package Overview
Dependencies
4
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    load-yaml-file

Read and parse a YAML file.


Version published
Weekly downloads
1.3M
decreased by-22.75%
Maintainers
1
Install size
606 kB
Created
Weekly downloads
 

Readme

Source

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
  • write-yaml-file - Stringify and write YAML to a file atomically
  • load-json-file - Read and parse a JSON file

FAQs

Last updated on 21 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc