hz-zhhq-web/node_modules/detect-newline
zzyuan 304842bddc 前端提交2 2025-02-25 13:44:33 +08:00
..
index.js 前端提交2 2025-02-25 13:44:33 +08:00
license 前端提交2 2025-02-25 13:44:33 +08:00
package.json 前端提交2 2025-02-25 13:44:33 +08:00
readme.md 前端提交2 2025-02-25 13:44:33 +08:00

readme.md

detect-newline Build Status

Detect the dominant newline character of a string

Install

$ npm install --save detect-newline

Usage

const detectNewline = require('detect-newline');

detectNewline('foo\nbar\nbaz\r\n');
//=> '\n'

API

detectNewline(input)

Returns detected newline or null when no newline character is found.

detectNewline.graceful(input)

Returns detected newline or \n when no newline character is found.

License

MIT © Sindre Sorhus