This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http') | |
class HttpStore { | |
constructor(storeUrl) { | |
// begin downloading the url we requested, stream it to our handleData function | |
http.get(storeUrl, (res) => { | |
res.on('data', this.handleData.bind(this)) | |
res.on('end', this.handleEnd.bind(this)) |
OlderNewer