5514949df0
We don't use a lot of the features of `glob`, so let's remove it in favor of a leaner approach using regex.
It's failing on windows and I have no idea why and don't own a windows machine 🤦🏼♂️
(Ignore some of the commits in here, I forgot to create the new branch before I started working)
21 lines
514 B
JavaScript
21 lines
514 B
JavaScript
const { join } = require('path')
|
|
const { recursiveReadDir } = require('next/dist/lib/recursive-readdir')
|
|
const resolveDataDir = join(__dirname, 'fixtures')
|
|
|
|
async function test () {
|
|
const time = process.hrtime()
|
|
await recursiveReadDir(resolveDataDir, /\.js$/)
|
|
|
|
const hrtime = process.hrtime(time)
|
|
const nanoseconds = (hrtime[0] * 1e9) + hrtime[1]
|
|
const milliseconds = nanoseconds / 1e6
|
|
console.log(milliseconds)
|
|
}
|
|
|
|
async function run () {
|
|
for (let i = 0; i < 50; i++) {
|
|
await test()
|
|
}
|
|
}
|
|
|
|
run()
|