title: Made a JSON file with multiple objects with a simple template
body: <p>I have a template JSON file used by REST API POST request. This file contains this object</p>
  
  <pre><code>{
      "Subject": "template",
      "Body": {
          "ContentType": "HTML",
          "Content": "template"
      },
      "Start": {
          "DateTime": "2014-02-02T18:00:00",
          "TimeZone": "Europe/Paris"
      },
      "End": {
          "DateTime": "2014-02-02T19:00:00",
          "TimeZone": "Europe/Paris"
      }
  }
  </code></pre>
  
  <p>I wrote a little function to change some datas inside this object and save this into another json file called <code>jsonOutput.json</code></p>
  
  <p>There is the function to change datas, this is working well.</p>
  
  <pre><code>function insertDatasJson (res) {
      let fs = require('fs');
      let base = require('../public/json/template.json');
  
      base.Subject = 'f';
      base.Body.Content = 'e';
      base.Start.DateTime = '2016-11-13T08:30:00';
      base.End.DateTime = '2016-11-13T17:30:00';
  
      fs.writeFileSync('./public/json/output/jsonOutput.json', JSON.stringify(base, null, 4));
  }
  </code></pre>
  
  <p>Now I trying to do the same modifications but I have a lot of datas to modify (multiple Subject, multiple Content and multiple Start/End dates)</p>
  
  <p>I trying to have an output file like this</p>
  
  <pre><code>[
      {
          "Subject": "1",
          "Body": {
              "ContentType": "HTML",
              "Content": "1"
          },
          "Start": {
              "DateTime": "2014-02-02T18:00:00",
              "TimeZone": "Europe/Paris"
          },
          "End": {
              "DateTime": "2014-02-02T19:00:00",
              "TimeZone": "Europe/Paris"
          }
      },
      // some other objects ...
      {
          "Subject": "n",
          "Body": {
              "ContentType": "HTML",
              "Content": "n"
          },
          "Start": {
              "DateTime": "2014-02-02T18:00:00",
              "TimeZone": "Europe/Paris"
          },
          "End": {
              "DateTime": "2014-02-02T19:00:00",
              "TimeZone": "Europe/Paris"
          }
      }
  ]
  </code></pre>
  
  <p>The problem is, if I do a simple loop in my little function, every data will overwrite the one before and I will get an output file like the template.</p>
  
  <p>How can I make to not overwrite datas during the loop and to have an output file like my example ?</p>