MCPcopy Create free account
hub / github.com/Script-Hub-Org/Script-Hub / readdir

Function readdir

SurgeModuleTool_macOS.js:27–40  ·  view source on GitHub ↗
(dirPath)

Source from the content-addressed store, hash-verified

25const modules = []
26
27function readdir(dirPath) {
28 const files = fs.readdirSync(dirPath)
29
30 files.forEach(file => {
31 const filePath = path.join(dirPath, file)
32 const stat = fs.statSync(filePath)
33
34 if (stat.isDirectory()) {
35 readdir(filePath)
36 } else if (file && !/\.(conf|txt|js|list)$/i.test(file) && !/^\./i.test(file)) {
37 modules.push({ file, filePath })
38 }
39 })
40}
41!(async () => {
42 readdir(moduledir)
43

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected