UNPKG

@visulima/fs

Version:

Human friendly file system utilities for Node.js

11 lines (8 loc) 454 B
import { parse } from 'yaml'; import readFileSync from './readFileSync-BDgEnnqT.js'; 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); } export { readYamlSync as default };