Skip to content

Commit

Permalink
Merge pull request #34 from eladb/default-write-linebreaks
Browse files Browse the repository at this point in the history
Fallback writeOptions.lineBreak not consistent, default to "\r\n"
  • Loading branch information
Worms David committed Jul 1, 2012
2 parents 413c742 + 38de700 commit 5a8529b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/csv.js
Expand Up @@ -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'){
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Expand Up @@ -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.
Expand Down

0 comments on commit 5a8529b

Please sign in to comment.