UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

16 lines (12 loc) 647 B
'use strict'; const yaml = require('yaml'); const readFileSync = require('./readFileSync-B3NTOR-W.cjs'); var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); function readYamlSync(path, reviver, options) { const { buffer, compression, encoding = "utf8", flag, ...parseOptions } = options ?? {}; const content = readFileSync(path, { buffer, compression, encoding, flag }); return typeof reviver === "function" ? yaml.parse(content, reviver, parseOptions) : yaml.parse(content, parseOptions); } __name(readYamlSync, "readYamlSync"); module.exports = readYamlSync;