title: How to create an JSON array using node-csvtojson?
body: <p>When using <a href="https://github.com/Keyang/node-csvtojson" rel="nofollow noreferrer">node-csvtojson</a> how can I output data as a json array?</p>
  
  <pre><code>const request = require("request");
  const csv = require("csvtojson");
  const fs = require("fs");
  
  const readStream = request.get("http://www.example.com/some.csv");
  const writeStream = fs.createWriteStream("./some.json");
  const converter = csv({
    includeColumns: /Column3|Column2/
  });
  
  readStream.pipe(converter).pipe(writeStream);
  </code></pre>
  
  <p>Assuming the following data structure:</p>
  
  <pre><code>Column1,Column2,Column3
  1,2,3
  one,two,three
  </code></pre>
  
  <p>I would expect the output file to contain:</p>
  
  <pre><code>[
    { "Column2": "2", "Column3": "3" },
    { "Column2": "two", "Column3": "three" }
  ]
  </code></pre>
  
  <p>I actually get the following:</p>
  
  <pre><code>{ "Column2": "2", "Column3": "3" }
  { "Column2": "two", "Column3": "three" }
  </code></pre>
  
  <p>How to I ensure that I get a JSON array as output?</p>
  
  <p>I am aware of <a href="https://github.com/Keyang/node-csvtojson/issues/107" rel="nofollow noreferrer">this issue</a> but I notice that <code>toArrayString</code> has been removed from the api.</p>