$ npm install detect-newline-cliDetect the dominant newline character
npm install --global detect-newline-cli
$ detect-newline --help
Usage
$ detect-newline <string>
$ cat unicorn.txt | detect-newline
Example
$ detect-newline "$(printf 'Unicorns\nRainbows')"
\n