MCPcopy
hub / github.com/tinyplex/tinybase / forEachDirAndFile

Function forEachDirAndFile

gulpfile.mjs:157–165  ·  view source on GitHub ↗
(dir, dirCallback, fileCallback, extension = '')

Source from the content-addressed store, hash-verified

155 );
156
157const forEachDirAndFile = (dir, dirCallback, fileCallback, extension = '') =>
158 readdirSync(dir, {withFileTypes: true}).forEach((entry) => {
159 const path = resolve(join(dir, entry.name));
160 if (entry.isDirectory()) {
161 dirCallback?.(path);
162 } else if (path.endsWith(extension)) {
163 fileCallback?.(path);
164 }
165 });
166
167const copyWithReplace = async (src, replacements, dst = src) =>
168 await promises.writeFile(

Callers 1

forEachDeepFileFunction · 0.70

Calls 1

joinFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…