Permalink
Browse files

allow for append flag via options.flags

  • Loading branch information...
1 parent dc81f24 commit 077758c5e820521eb79a259ab6190860de7c3102 @davidmarkclements davidmarkclements committed Feb 24, 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 077758c

Please sign in to comment.