@stryke/fs
Version:
A package containing various file system utilities that expand the functionality of NodeJs's built-in `fs` module.
40 lines (38 loc) • 1.28 kB
JavaScript
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
var yaml_exports = /* @__PURE__ */ require_runtime.__exportAll({
readYamlFile: () => readYamlFile,
readYamlFileSync: () => readYamlFileSync
});
/**
* 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;
Object.defineProperty(exports, 'yaml_exports', {
enumerable: true,
get: function () {
return yaml_exports;
}
});