|
||||
---|---|---|---|---|
.. | ||||
index.js | 11e3a9652a | 7 年之前 | ||
license | 11e3a9652a | 7 年之前 | ||
package.json | 11e3a9652a | 7 年之前 | ||
readme.md | 11e3a9652a | 7 年之前 |
Detect the dominant newline character of a string
$ npm install --save detect-newline
const detectNewline = require('detect-newline');
detectNewline('foo\nbar\nbaz\r\n');
//=> '\n'
Returns detected newline or null
when no newline character is found.
Returns detected newline or \n
when no newline character is found.
MIT © Sindre Sorhus