title: How to read and write data from csv using fast csv
body: <p>I am reading data from a csv and transforming the data.
  Now i want to write the data to a new csv but the file is getting created but the data is not getting populated.</p>
  
  <p>here is what i have tried</p>
  
  <pre><code>const fs = require('fs');
  var csv = require("fast-csv");
  
  var stream = fs.createReadStream("/home/rahul/Downloads/it.csv");
  var ws = fs.createWriteStream("/home/rahul/Downloads/my.csv");
  
  csv
   .fromStream(stream)
   .transform(function(data){
      return data.map(function(ip) {
          return Number(
              ip.split(".")
                .map(d =&gt; ("000"+d).substr(-3) )
                .join("")
            );   
      })
  
   })
   .on("data", function(data){
       console.log(data); // this logs [ 5009000000, 5009255255 ]
   })
   .on("end", function(data){
      csv.write(data).pipe(ws);
  
   });
  </code></pre>