Files
release-action/node_modules/detect-newline
Nick Cipollo 8f5d96dce1
Some checks failed
PR Checks / check_pr (push) Has been cancelled
Prepare v1.8.2 release
2021-03-21 20:02:09 -04:00
..
2021-03-21 20:02:09 -04:00
2021-03-21 20:02:09 -04:00
2021-03-21 20:02:09 -04:00
2021-03-21 20:02:09 -04:00
2021-03-21 20:02:09 -04:00

detect-newline Build Status

Detect the dominant newline character of a string

Install

$ npm install detect-newline

Usage

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

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

API

detectNewline(string)

Returns the detected newline or undefined when no newline character is found.

detectNewline.graceful(unknown)

Returns the detected newline or \n when no newline character is found or the input is not a string.

License

MIT © Sindre Sorhus