MCPcopy Create free account
hub / github.com/LearnPrompt/LearnPrompt / processDirectory

Function processDirectory

scripts/dyno_to_new_embed.ts:61–70  ·  view source on GitHub ↗
(directory: string)

Source from the content-addressed store, hash-verified

59
60// Function to recursively iterate through all files in a given path
61function processDirectory(directory: string) {
62 fs.readdirSync(directory).forEach(file => {
63 let fullPath = path.join(directory, file);
64 if (fs.lstatSync(fullPath).isDirectory()) {
65 processDirectory(fullPath);
66 } else {
67 processFile(fullPath);
68 }
69 });
70}
71// Function to process a single file
72function processFile(filePath: string) {
73 fs.readFile(filePath, 'utf8', function(err, data) {

Callers 1

Calls 1

processFileFunction · 0.85

Tested by

no test coverage detected