ryanve / eol

JavaScript newline character converter

Home Page:https://www.npmjs.com/package/eol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inverse functions

NicoBurno opened this issue · comments

commented

After the eol.split() and the machinations with the lines, I need to collect an array of lines back into the string...
The problem is that I do not know what linebreak to use for array.join()...

Maybe we will add support eol.getLinebreak() or/and eol.join(array)?

Since 0.9.0 you can actually do [].join(eol.auto) and it will use the appropriate character. Or you can directly access it as String(eol.auto). #14 adds documentation for this. How's that?

commented

@ryanve, thanks for the documentation! This is really better than the functions I proposed

For sure—sweet! That idea came from @usergenic