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

Function main

benchmark/module/module-loader-deep.js:14–36  ·  view source on GitHub ↗
({ ext, cache, files })

Source from the content-addressed store, hash-verified

12});
13
14function main({ ext, cache, files }) {
15 tmpdir.refresh();
16 fs.mkdirSync(benchmarkDirectory);
17 fs.writeFileSync(
18 `${benchmarkDirectory}/a.js`,
19 'module.exports = {};',
20 );
21 for (let i = 0; i <= files; i++) {
22 fs.mkdirSync(`${benchmarkDirectory}/${i}`);
23 fs.writeFileSync(
24 `${benchmarkDirectory}/${i}/package.json`,
25 '{"main": "index.js"}',
26 );
27 fs.writeFileSync(
28 `${benchmarkDirectory}/${i}/index.js`,
29 `require('../a${ext}');`,
30 );
31 }
32
33 measureDir(cache === 'true', files);
34
35 tmpdir.refresh();
36}
37
38function measureDir(cache, files) {
39 if (cache) {

Callers

nothing calls this directly

Calls 4

measureDirFunction · 0.70
refreshMethod · 0.45
mkdirSyncMethod · 0.45
writeFileSyncMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…