source: frontend/node_modules/detect-newline/readme.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 906 bytes
Line 
1# detect-newline [![Build Status](https://travis-ci.org/sindresorhus/detect-newline.svg?branch=master)](https://travis-ci.org/sindresorhus/detect-newline)
2
3> Detect the dominant newline character of a string
4
5
6## Install
7
8```
9$ npm install detect-newline
10```
11
12
13## Usage
14
15```js
16const detectNewline = require('detect-newline');
17
18detectNewline('foo\nbar\nbaz\r\n');
19//=> '\n'
20```
21
22
23## API
24
25### detectNewline(string)
26
27Returns the detected newline or `undefined` when no newline character is found.
28
29### detectNewline.graceful(unknown)
30
31Returns the detected newline or `\n` when no newline character is found or the input is not a string.
32
33
34## Related
35
36- [detect-newline-cli](https://github.com/sindresorhus/detect-newline-cli) - CLI for this module
37- [detect-indent](https://github.com/sindresorhus/detect-indent) - Detect the indentation of code
38
39
40## License
41
42MIT © [Sindre Sorhus](https://sindresorhus.com)
Note: See TracBrowser for help on using the repository browser.