title: Writing into a JSON (Node for Discord.JS)
body: <p>I wrote a command that is supposed to change a prefix by the new one the user specified.
  My prefix is written in a file named &quot;config.json&quot; that can be found at the root of my project.</p>
  <p>My command, in a file named &quot;setprefix.js&quot; and located in the &quot;commands&quot; folder, is the following :</p>
  <pre><code>const config = require('../config.json')
  const fs = require('fs')
  
  module.exports = {
      run: async (message, args) =&gt; {
          if(!message.author === config.ownerID) return message.channel.send(&quot;Only the owner can change the prefix!&quot;);
          if(!args[0]) return message.channel.send(&quot;Please specify the new prefix !&quot;)
          config.prefix = args[0];
          await fs.writeFile('../config.json', JSON.stringify(config), (err) =&gt; {
              if (err) console.log(err);
          });
          console.log(config.prefix)
      },
      name: 'setprefix',
      help: {
          description: 'Changes server prefix',
          syntax: '&lt;new prefix&gt;'
      }
  }
  </code></pre>
  <p>no callback so no error triggered, but still no changes in my config.json file.
  I've also tried the writeFileSync variant with no success
  Code is reached and config.prefix is set with the right informations</p>
  <p>Could you please help me, I must have been missing something but I sincerely don't understand what I'm doing wrong</p>
  <p>Thanks in advance</p>