MCPcopy Index your code
hub / github.com/nodejs/node / createFiles

Function createFiles

test/sequential/test-fs-opendir-recursive.js:68–78  ·  view source on GitHub ↗
(path, fileStructure)

Source from the content-addressed store, hash-verified

66];
67
68function createFiles(path, fileStructure) {
69 for (const fileOrDir of fileStructure) {
70 if (typeof fileOrDir === 'string') {
71 fs.writeFileSync(pathModule.join(path, fileOrDir), '');
72 } else {
73 const dirPath = pathModule.join(path, fileOrDir[0]);
74 fs.mkdirSync(dirPath);
75 createFiles(dirPath, fileOrDir[1]);
76 }
77 }
78}
79
80// Make sure tmp directory is clean
81tmpdir.refresh();

Callers 1

Calls 3

writeFileSyncMethod · 0.45
joinMethod · 0.45
mkdirSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…