Skip to content

Instantly share code, notes, and snippets.

@flimshaw
Last active October 10, 2016 20:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flimshaw/56ae49e09beef5e67555a07bf777b83d to your computer and use it in GitHub Desktop.
Save flimshaw/56ae49e09beef5e67555a07bf777b83d to your computer and use it in GitHub Desktop.
function processFile(file) {
fs.createReadStream(file) // open the gzipped csv file and start sending chunks of it downstream
.pipe(zlib.createGunzip()) // once you get a chunk, decompress it and pass it downstream
.pipe(csv()) // convert the decompressed chunk into individual rows and values
.on('data', processRow(row)) // if a row has a parallax measurement, calculate its position and write it to a new file
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment