Detect 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
- detect-newline - API for this module
- detect-indent-cli - Detect the indentation of code