UNPKG

@stryke/fs

Version:

A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.

30 lines (28 loc) 1.01 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('./_virtual/_rolldown/runtime.cjs'); const require_read_file = require('./read-file.cjs'); let yaml = require("yaml"); //#region src/yaml.ts /** * Reads a YAML file and returns the object the YAML content represents. * * @param path - A path to a file. * @param options - YAML parse options * @returns Object the YAML content of the file represents */ function readYamlFileSync(path, options) { return (0, yaml.parse)(require_read_file.readFileSync(path), options); } /** * Reads a YAML file and returns the object the YAML content represents. * * @param path - A path to a file. * @param options - YAML parse options * @returns Object the YAML content of the file represents */ async function readYamlFile(path, options = {}) { return (0, yaml.parse)(await require_read_file.readFile(path), options); } //#endregion exports.readYamlFile = readYamlFile; exports.readYamlFileSync = readYamlFileSync;