Guest User

Untitled

a guest
Jul 11th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. let stream = fs.createReadStream("Supliers.csv");
  2.  
  3. let csvStream = csv({headers: true})
  4. .on("data", function(data){
  5. /*data.forEach(x => {
  6. console.log(x)
  7. })*/
  8.  
  9. Final.push(data)
  10. })
  11. .on("end", function(){
  12. console.log(Final);//[THE COMPLETE DATA TOTALLY OK]
  13. });
  14.  
  15. stream.pipe(csvStream);
  16.  
  17. console.log(Final)// []
Add Comment
Please, Sign In to add comment