({ n, name, cache, files, dir })
| 19 | }, { flags: '--no-warnings' }); |
| 20 | |
| 21 | function main({ n, name, cache, files, dir }) { |
| 22 | tmpdir.refresh(); |
| 23 | fs.mkdirSync(benchmarkDirectory); |
| 24 | for (let i = 0; i <= files; i++) { |
| 25 | fs.mkdirSync(`${benchmarkDirectory}${i}`); |
| 26 | fs.writeFileSync( |
| 27 | `${benchmarkDirectory}${i}/package.json`, |
| 28 | '{"main": "index.js"}', |
| 29 | ); |
| 30 | fs.writeFileSync( |
| 31 | `${benchmarkDirectory}${i}/index.js`, |
| 32 | 'module.exports = "";', |
| 33 | ); |
| 34 | } |
| 35 | |
| 36 | if (dir === 'rel') |
| 37 | benchmarkDirectory = path.relative(__dirname, benchmarkDirectory); |
| 38 | |
| 39 | measureDir(n, cache === 'true', files, name); |
| 40 | |
| 41 | tmpdir.refresh(); |
| 42 | } |
| 43 | |
| 44 | function measureDir(n, cache, files, name) { |
| 45 | if (cache) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…