title: Discord.js write data to file
body: <p>Heyo,
  I need help here. I want to structure a JSON file. Down here I can explain it a little bit better:</p>
  <p>I have a channelId and a serverName and I want to safe these in a config file with fs.
  Here is how it would look now:</p>
  <pre><code>    {
    &quot;server&quot;: &quot;MyServer&quot;
      }
  </code></pre>
  <p>But I want it to look like this:</p>
  <pre><code>[
    {
      &quot;channelId&quot;: &quot;MyChannel&quot;,
      &quot;info&quot;: [
        {
          &quot;server&quot;: &quot;MyServer&quot;
        }
      ]
    }
  ]
  </code></pre>
  <p>Here is my code:</p>
  <pre><code>const server = &quot;MyServer&quot;
  const channel = &quot;MyChannel&quot; //I want this to be at the top
  
    const template = {           //this must be edited i think
      server: &quot;Cool Server&quot;,     
    }
     template.server = server;
    fs.writeFileSync(&quot;channels.json&quot;, JSON.stringify(template, null, 2));
  </code></pre>
  <p>With &quot;server&quot; I mean the server where the channel exists.
  Thanks for helping me ;-)</p>