UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

14 lines (11 loc) 622 B
import { parse } from 'yaml'; import readFileSync from './readFileSync-CkEJBqZB.mjs'; 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" ? parse(content, reviver, parseOptions) : parse(content, parseOptions); } __name(readYamlSync, "readYamlSync"); export { readYamlSync as default };