Created
December 12, 2018 15:26
-
-
Save DanyelMorales/7d949d9a67724c5443fa957f955db9ea to your computer and use it in GitHub Desktop.
Detect and return OS specific line ending.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Detect and return OS specific line ending. | |
* | |
* @returns {String} | |
*/ | |
function detectLineEnding() { | |
if ( os.platform() === 'win32' ) | |
return '\r\n'; | |
if ( os.platform() === 'darwin' ) | |
return '\r'; | |
return '\n'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment