title: How to import a function in javascript?
body: <p>I am currently coding a Discord bot in JS with Node.js and I wanted to write the commands code in a file for each command. All of these files are in a commands folder. Here is my code : in index.js :</p>
  <pre><code>const help = require(&quot;./commands/help.js&quot;)
  help.help()
  </code></pre>
  <p>and in help.js :</p>
  <pre><code>function help() {
      const embed = new Discord.MessageEmbed()
          .setColor(&quot;#0099ff&quot;)
          .setTitle(&quot;Commandes du serveur&quot;)
          .addField(&quot;&amp;help&quot;, &quot;Commandes du bot&quot;)
          .addField(&quot;&amp;youtube&quot;, &quot;Lien vers la chaîne YouTube d'ANGI49&quot;)
          .addField(&quot;&amp;twitch&quot;, &quot;Lien vers la chaîne Twitch d'ANGI49&quot;)
          .setFooter(&quot;Bot développé par ANGI498045 et ywalt.js&quot;)
  
      message.reply({ embeds: [embed]});
  }
  module.exports()
  </code></pre>
  <p>The import never works and i have a module not found error
  Thanks</p>