universal-eol get the EOL char in both nodejs and browser environment npm i universal-eol -S var eol = require('universal-eol').EOL; //just like require('os').EOL License MIT