Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
readdir-scoped.js21 linesDownload Raw Back to lib
1const { readdir } = require('fs/promises')
2const { join } = require('path')
3
4const readdirScoped = async (dir) => {
5  const results = []
6
7  for (const item of await readdir(dir)) {
8    if (item.startsWith('@')) {
9      for (const scopedItem of await readdir(join(dir, item))) {
10        results.push(join(item, scopedItem))
11      }
12    } else {
13      results.push(item)
14    }
15  }
16
17  return results
18}
19
20module.exports = readdirScoped
21 
codekingpro/portable-devtools · Team Ai