I'm trying to include multiple folders in JavaScript, specific: Discord JS, here's my code:
const commandFiles = fs.readdirSync('./aPublic').filter(file => file.endsWith('.js')); // I wanted to include it here
for (const file of commandFiles) {
const command = require(`./aPublic/${file}`); // I wanted to include it here too!
client.commands.set(command.name, command);
}
I've tried to use ./aPublic && ./bAdmin and also ('./aPublic') && ('./bAdmin') but it only read the "bAdmin" folder rather than both of them, I wanted to include like 7 folders in both code.
path.join(__dirname, './aPublic/')for readdirSync path?const path = require("path");