Initial commit
[yaffs-website] / node_modules / trim-newlines / readme.md
1 # trim-newlines [![Build Status](https://travis-ci.org/sindresorhus/trim-newlines.svg?branch=master)](https://travis-ci.org/sindresorhus/trim-newlines)
2
3 > Trim [newlines](https://en.wikipedia.org/wiki/Newline) from the start and/or end of a string
4
5
6 ## Install
7
8 ```
9 $ npm install --save trim-newlines
10 ```
11
12
13 ## Usage
14
15 ```js
16 var trimNewlines = require('trim-newlines');
17
18 trimNewlines('\nunicorn\r\n');
19 //=> 'unicorn'
20 ```
21
22
23 ## API
24
25 ### trimNewlines(input)
26
27 Trim from the start and end of a string.
28
29 ### trimNewlines.start(input)
30
31 Trim from the start of a string.
32
33 ### trimNewlines.end(input)
34
35 Trim from the end of a string.
36
37
38 ## Related
39
40 - [trim-left](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left
41 - [trim-right](https://github.com/sindresorhus/trim-right) - Similar to `String#trim()` but removes only whitespace on the right.
42
43
44 ## License
45
46 MIT © [Sindre Sorhus](http://sindresorhus.com)