cool-admin-vue/build/cool/lib/modules/index.ts

12 lines
276 B
TypeScript
Raw Normal View History

2022-04-02 22:50:51 +08:00
import fs from "fs";
import { join } from "path";
export function getModules() {
try {
2022-04-08 13:19:55 +08:00
const dirs = fs.readdirSync(join(__dirname, "../../../../src/modules"));
2022-04-02 22:50:51 +08:00
return Promise.resolve(dirs.filter((e) => !e.includes(".")));
2022-04-08 13:19:55 +08:00
} catch (e) {
return Promise.reject(e);
}
2022-04-02 22:50:51 +08:00
}