MCPcopy Create free account
hub / github.com/Silentely/eSIM-Tools / listFiles

Function listFiles

scripts/deploy-analyze.js:9–22  ·  view source on GitHub ↗
(dir, base = dir)

Source from the content-addressed store, hash-verified

7const distDir = path.join(__dirname, '..', 'dist');
8
9function listFiles(dir, base = dir) {
10 const output = [];
11 for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
12 const full = path.join(dir, entry.name);
13 if (entry.isDirectory()) {
14 output.push(...listFiles(full, base));
15 } else {
16 const rel = path.relative(base, full);
17 const size = fs.statSync(full).size;
18 output.push({ rel, size });
19 }
20 }
21 return output;
22}
23
24(function main() {
25 if (!fs.existsSync(distDir)) {

Callers 1

deploy-analyze.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected