no just write your code with '\n' and that's enough.
since get the text from textarea means exporting to a text form that can be represent as file or whatever and then so
from https://en.wikipedia.org/wiki/Newline
When writing to a file, device node, or socket/fifo in text mode, '\n'
is transparently translated to the native newline sequence used by the
system, which may be longer than one character. When reading in text
mode, the native newline sequence is translated back to '\n'. In
binary mode, no translation is performed, and the internal
representation produced by '\n' is output directly.
it's very depends on what you want to do with it. if you send it back to your server then it's depends on you if you want to export it to user as a file then it's OS. but generally it's almost always safe to just use '\n' since it's been more common and generally accepted.
$(function(){
var $text = $("#text");
$text.val( $text.val() + "Hello \nThis is '\\r' a \r" + // here
"multi-line (\\r\\n) \r\n text with" + // here CRLF
" differents \n linefeeds" );
var s = $text.val().split('\n');
// notice line 3 on output, it's been feed by '\r'
// and we split only by '\n'
$text.val( s.map( (ss,n) => n + "\t" + ss ).join("\n") );
$("#wonder").on("click",function() {
$text.val( $text.val().split("\n").join("\t\\r\r") );
// var s = $text.val();
// either sending it via AJAX or
// export it to user, it's safe to go with '\n' .
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<textarea id="text" rows="7" cols="37"> Hey<br>there\n
</textarea> <br>
<button id="wonder">wonder</button>