Permalink
Browse files

Merge branch 'master' of github.com:wdavidw/node-csv-parser

  • Loading branch information...
2 parents 49d9cf3 + 58eb3c0 commit 18066b35e4c540a594e21813d4c3ed0a560836b8 @wdavidw committed Apr 1, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/csv.js
View
@@ -1,4 +1,3 @@
-
// Module CSV - Copyright David Worms <open@adaltas.com> (BSD Licensed)
var EventEmitter = require('events').EventEmitter,
@@ -49,6 +48,8 @@ module.exports = function(){
delimiter: null,
quote: null,
escape: null,
+ columns: null,
+ columnNames: false,
lineBreaks: null,
flags: 'w',
encoding: 'utf8',
@@ -406,6 +407,10 @@ module.exports = function(){
if(csv.readOptions.columns){
if(state.count === 0 && csv.readOptions.columns === true){
csv.readOptions.columns = state.line;
+ if(csv.writeOptions.columnNames === true)
+ {
+ write(csv.writeOptions.columns || csv.readOptions.columns);
+ }
state.line = [];
state.lastC = '';
return;

0 comments on commit 18066b3

Please sign in to comment.