simple structure

This commit is contained in:
2026-02-09 01:53:04 +01:00
parent 170cb9bc39
commit e344f15430
6 changed files with 33 additions and 9 deletions
+24
View File
@@ -0,0 +1,24 @@
import fs from "fs";
import path from "path";
export async function listWsFiles(dir: string) {
const files: string[] = [];
function walk(currentDir: string) {
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
for (const entry of entries) {
const fullPath = path.join(currentDir, entry.name);
if (entry.isDirectory()) {
walk(fullPath);
} else if (entry.isFile() && entry.name === "ws.ts") {
files.push(fullPath);
}
}
}
walk(dir);
const modules = await Promise.all(files.map((file) => import(file)));
return modules;
}