MCPcopy Index your code
hub / github.com/awesome-opencode/awesome-opencode / readYamlFile

Function readYamlFile

scripts/utils/yaml.js:15–22  ·  view source on GitHub ↗

* Read and parse a single YAML file * @param {string} filePath - Path to YAML file * @returns {object} Parsed YAML object

(filePath)

Source from the content-addressed store, hash-verified

13 * @returns {object} Parsed YAML object
14 */
15function readYamlFile(filePath) {
16 try {
17 const content = fs.readFileSync(filePath, 'utf8');
18 return yaml.load(content, { filename: filePath });
19 } catch (e) {
20 throw new Error(`Failed to parse ${filePath}: ${e.message}`);
21 }
22}
23
24/**
25 * Read all YAML files from a directory

Callers 1

readYamlDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected