Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. const fs = require('fs')
  2. const highland = require('highland')
  3.  
  4. highland(fs.createReadStream('customers.csv', 'utf8'))
  5. .split()
  6. .map(line => line.split(','))
  7. .map(parts => ({
  8. name: parts[0],
  9. numPurchases: parts[1]
  10. }))
  11. .filter(customer => customer.numPurchases > 5)
  12. .map(customer => customer.name)
  13. .each(x => console.log('each: ', x))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement