Skip to content

Commit

Permalink
Default linebreaks to unix style "\n"
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Jul 1, 2012
1 parent 5a8529b commit 18f0bae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/csv.js
Expand Up @@ -74,7 +74,7 @@ module.exports = function(){
process.nextTick(function(){
if(data instanceof Array){
if( csv.writeOptions.lineBreaks === null ){
csv.writeOptions.lineBreaks = "\r\n";
csv.writeOptions.lineBreaks = "\n";
}
for(var i=0; i<data.length; i++){
state.line = data[i];
Expand Down 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\n" : '';
var newLine = state.countWriten ? csv.writeOptions.lineBreaks || "\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 or 'windows' if no source is specified).
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 'unix' 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 18f0bae

Please sign in to comment.