Permalink
Browse files

Default linebreaks to unix style "\n"

  • Loading branch information...
1 parent 5a8529b commit 18f0bae6bfdea9c19bfcfc987e12b4e91fd7a909 @wdavidw committed Jul 1, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/csv.js
  2. +1 −1 readme.md
View
@@ -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];
@@ -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'){
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 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.

0 comments on commit 18f0bae

Please sign in to comment.