I made this code:
var Discord = require('discord.js');
var client = new Discord.Client();
var fs = require('fs');
var dotenv = require('dotenv');
var option = require('./assets/config.json');
dotenv.config({
    path: __dirname + '/assets/.env'
});
client.on('ready', function () {
    console.log(`Logged in as ${client.user.tag}`);
});
client.on('message', function (message) {
    var done = false;
    if (!message.content.startsWith('/')) return;
    var args = message.content.substr(1).split(' ');
    fs.readdir('./cmd/', function (err, list) {
        for (var i = 0; i < list.length; i++) {
            var cmds = require(`./cmd/${list[i]}`);
            for (var x = 0; x < cmds.alises.length; x++) {
                for (var a = 0; a < args.length; a++) {
                    if (args[a] == cmds.alises[x] && !done) {
                        cmds.run(client, message, args, option);
                        done = true;
                    }
                }
            }
        }
    });
});
client.login(process.env.TOKEN);
And I thought that I don't have to restart this main file when I edit the module files because in this code Node.js reads all the files instantly on messages. But when I edit the module file, I should restart the main file. Why is this thing happens?
