NodeJS, promises, streams - processing large CSV files
问题 I need to build a function for processing large CSV files for use in a bluebird.map() call. Given the potential sizes of the file, I'd like to use streaming. This function should accept a stream (a CSV file) and a function (that processes the chunks from the stream) and return a promise when the file is read to end (resolved) or errors (rejected). So, I start with: 'use strict'; var _ = require('lodash'); var promise = require('bluebird'); var csv = require('csv'); var stream = require(