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

Function createFiles

test/sequential/test-fs-readdir-recursive.js:67–77  ·  view source on GitHub ↗
(path, fileStructure)

Source from the content-addressed store, hash-verified

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