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

Function loadYamlFile

scripts/validate.js:30–38  ·  view source on GitHub ↗

* Load and parse a YAML file * @param {string} filePath - Path to the YAML file * @returns {object|null} Parsed YAML object or null on error

(filePath)

Source from the content-addressed store, hash-verified

28 * @returns {object|null} Parsed YAML object or null on error
29 */
30function loadYamlFile(filePath) {
31 try {
32 const content = fs.readFileSync(filePath, 'utf8');
33 return yaml.load(content);
34 } catch (err) {
35 console.error(`Error reading ${filePath}: ${err.message}`);
36 return null;
37 }
38}
39
40/**
41 * Validate a single file

Callers 1

validateFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected