Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

Fallback writeOptions.lineBreak not consistent, default to "\r\n"
  • Loading branch information...
commit 5a8529bff79d7253c5b128fedc780c5d92fc9043 2 parents 413c742 + 38de700
@wdavidw authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/csv.js
  2. +1 −1  readme.md
View
2  lib/csv.js
@@ -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
2  readme.md
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.