Skip to content

Instantly share code, notes, and snippets.

@fercreek
Created August 24, 2016 03:18
Show Gist options
  • Save fercreek/c41cd0b0eb54068703eeb619a189563e to your computer and use it in GitHub Desktop.
Save fercreek/c41cd0b0eb54068703eeb619a189563e to your computer and use it in GitHub Desktop.
const fs = require('fs')
const highland = require('highland')
highland(fs.createReadStream('customers.csv', 'utf8'))
.split()
.map(line => line.split(','))
.map(parts => ({
name: parts[0],
numPurchases: parts[1]
}))
.filter(customer => customer.numPurchases > 5)
.map(customer => customer.name)
.each(x => console.log('each: ', x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment