aboutsummaryrefslogtreecommitdiff
path: root/node_modules/trim-off-newlines/readme.md
blob: 36626d90a5220654e43f5f99982cda0e02a500fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# trim-off-newlines [![Build Status](https://travis-ci.org/stevemao/trim-off-newlines.svg?branch=master)](https://travis-ci.org/stevemao/trim-off-newlines)

> Similar to [`String#trim()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) but removes only newlines


## Install

```
$ npm install --save trim-off-newlines
```


## Usage

```js
var trimOffNewlines = require('trim-off-newlines');

trimOffNewlines('\n\nunicorns\n\n');
//=> 'unicorns'
```


## Related

- [`trim-left`](https://github.com/sindresorhus/trim-left) - Similar to `String#trim()` but removes only whitespace on the left
- [`trim-right`](https://github.com/sindresorhus/trim-right) - Similar to `String#trim()` but removes only whitespace on the right


## License

MIT © [Steve Mao](https://github.com/stevemao)