Permalink
Browse files

Merge pull request #13 from davidmarkclements/master

include flags option to pass through to createRead/WriteStream.
  • Loading branch information...
2 parents 4003570 + 077758c commit e21d6f48dcfa5d6047142e6f22e25b1eff8174af @koles committed Feb 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/ya-csv.js
View
@@ -159,7 +159,7 @@ CsvReader.prototype._addRecord = function() {
csv.createCsvFileReader = function(path, options) {
options = options || {};
var readStream = fs.createReadStream(path, {
- 'flags': 'r'
+ 'flags': options.flags || 'r'
});
readStream.setEncoding(options.encoding || 'utf8');
return new CsvReader(readStream, options);
@@ -234,7 +234,7 @@ function _appendField(outArr, writer, field) {
csv.createCsvFileWriter = function(path, options) {
var writeStream = fs.createWriteStream(path, {
- 'flags': 'w'
+ 'flags': options.flags || 'w'
});
return new CsvWriter(writeStream, options);
};

0 comments on commit e21d6f4

Please sign in to comment.