title: Need to write an array of objects to a file from nodejs
body: <p>I have an array of objects like below that i have to write to a file with node js, the aim is to write one item per line into one file :</p>
  
  <pre><code>cont obj = [{a:1},{b:2}]
  </code></pre>
  
  <p>Output file content expected : </p>
  
  <pre><code>//file.json
  {a:1}
  {b:2}
  </code></pre>
  
  <p>My code without success </p>
  
  <pre><code>jsonfile.writeFileSync(filePath, JSON.stringify(obj), 'utf-8');
  /*
  * [\{a:1\},\{b:2\}] &lt;=== a string in one line with special characters 
  * doesn't fit on my need
  */
  </code></pre>
  
  <p>If someone could helps me,
  Thank you.</p>