Created
December 12, 2018 15:26
-
-
Save 0ct0d4n/e91e8f6a96f430027f4e0ea3b07143c7 to your computer and use it in GitHub Desktop.
Detect and return OS specific line ending.
This file contains hidden or 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