It is already there and is called LineEnding
That is fully cross-platform, of course there is always the caveat that you need to be careful how a file is written/read from storage. That can have some side effects (e.g length).
@Handoko Posts crossed...