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

Function readYamlDir

scripts/utils/yaml.js:29–38  ·  view source on GitHub ↗

* Read all YAML files from a directory * @param {string} dirPath - Directory containing YAML files * @returns {Promise } Array of parsed YAML objects with _filePath metadata

(dirPath)

Source from the content-addressed store, hash-verified

27 * @returns {Promise<object[]>} Array of parsed YAML objects with _filePath metadata
28 */
29async function readYamlDir(dirPath) {
30 const pattern = path.join(dirPath, '*.yaml').replace(/\\/g, '/');
31 const files = await glob(pattern);
32
33 return files.map(file => ({
34 ...readYamlFile(file),
35 _filePath: file,
36 _fileName: path.basename(file, '.yaml')
37 }));
38}
39
40/**
41 * Convert a name to a filename-safe slug

Callers 2

generateCategorySectionFunction · 0.85
loadEntriesFunction · 0.85

Calls 1

readYamlFileFunction · 0.85

Tested by

no test coverage detected