Skip to content

Commit

Permalink
Merge pull request #13 from davidmarkclements/master
Browse files Browse the repository at this point in the history
include flags option to pass through to createRead/WriteStream.
  • Loading branch information
koles committed Feb 26, 2012
2 parents 4003570 + 077758c commit e21d6f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ya-csv.js
Expand Up @@ -159,7 +159,7 @@ CsvReader.prototype._addRecord = function() {
csv.createCsvFileReader = function(path, options) { csv.createCsvFileReader = function(path, options) {
options = options || {}; options = options || {};
var readStream = fs.createReadStream(path, { var readStream = fs.createReadStream(path, {
'flags': 'r' 'flags': options.flags || 'r'
}); });
readStream.setEncoding(options.encoding || 'utf8'); readStream.setEncoding(options.encoding || 'utf8');
return new CsvReader(readStream, options); return new CsvReader(readStream, options);
Expand Down Expand Up @@ -234,7 +234,7 @@ function _appendField(outArr, writer, field) {


csv.createCsvFileWriter = function(path, options) { csv.createCsvFileWriter = function(path, options) {
var writeStream = fs.createWriteStream(path, { var writeStream = fs.createWriteStream(path, {
'flags': 'w' 'flags': options.flags || 'w'
}); });
return new CsvWriter(writeStream, options); return new CsvWriter(writeStream, options);
}; };
Expand Down

0 comments on commit e21d6f4

Please sign in to comment.