Answer the question
In order to leave comments, you need to log in
How to specify a relative path to a file?
Good evening, I'm trying to specify the relative path of the project. I have two folders. In the handlers folder I have a handler.js file with the following code:
const commandFiles = fs.readdirSync(`../commands/`).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`../commands/${file}`);
client.commands.set(command.name, command);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question