You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
515 B
JavaScript

4 years ago
const { readdirSync } = require(`fs`);
const { join } = require(`path`);
4 years ago
4 years ago
for (let type of readdirSync(join(__dirname, `module`)).filter(
f => !f.includes(`.`)
4 years ago
)) {
4 years ago
readdirSync(join(__dirname, `module`, type))
.filter(file => file !== `index.js` && file.endsWith(`.js`))
.map(File => {
const Name = File.split(`.`)[0];
exports[
Name.charAt(0).toUpperCase() + Name.slice(1)
] = require(`${__dirname}/module/${type}/${File}`);
});
4 years ago
}