Permalink
Browse files

Merge pull request #34 from eladb/default-write-linebreaks

Fallback writeOptions.lineBreak not consistent, default to "\r\n"
  • Loading branch information...
2 parents 413c742 + 38de700 commit 5a8529bff79d7253c5b128fedc780c5d92fc9043 Worms David committed Jul 1, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/csv.js
  2. +1 −1 readme.md
View
@@ -414,7 +414,7 @@ module.exports = function(){
line.splice(csv.writeOptions.columns.length);
}
if(line instanceof Array){
- var newLine = state.countWriten ? csv.writeOptions.lineBreaks || "\r" : '';
+ var newLine = state.countWriten ? csv.writeOptions.lineBreaks || "\r\n" : '';
for(var i=0; i<line.length; i++){
var field = line[i];
if(typeof field === 'string'){
View
@@ -145,7 +145,7 @@ Options are:
Display the column names on the first line if the columns option is provided.
- *lineBreaks*
- String used to delimit record rows or a special value; special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; default to 'auto' (discovered in source).
+ String used to delimit record rows or a special value; special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; default to 'auto' (discovered in source or 'windows' if no source is specified).
- *flags*
Default to 'w', 'w' to create or overwrite an file, 'a' to append to a file. Apply when using the `toPath` method.

0 comments on commit 5a8529b

Please sign in to comment.