title: nodejs synchronus call fast csv
body: <p>I'm using fast csv for csv file read below is code given below</p>
  
  <pre><code>var csv = require("fast-csv");
  csv.fromPath("userlists.csv")
  .transform(function(obj){
      return {
          email: obj.email,
          firstname: obj.firstname,
          lastname: obj.lastname
      };
  })       
  .on("data", function(data){
     // Some promise call for API
  
  })
  .on("end", function(){
      response.send("Imported successfully");
      console.log("done");
  });
  </code></pre>
  
  <p>Inside on("data", function(data){}) I'm calling some API using promise these API takes some time for processing. 
  After reading csv file "Imported successfully" is showing immediately without waiting for API processed.
  I want to print Imported successfully at end of all API processing.</p>