Sha256: 4dd25d1f742cd0d862c3652cd3f9028807666626a7ed087691e142d179b2e8db

Contents?: true

Size: 953 Bytes

Versions: 35

Compression:

Stored size: 953 Bytes

Contents

# trim-newlines [![Build Status](https://travis-ci.org/sindresorhus/trim-newlines.svg?branch=master)](https://travis-ci.org/sindresorhus/trim-newlines)

> Trim [newlines](https://en.wikipedia.org/wiki/Newline) from the start and/or end of a string


## Install

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


## Usage

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

trimNewlines('\nunicorn\r\n');
//=> 'unicorn'
```


## API

### trimNewlines(input)

Trim from the start and end of a string.

### trimNewlines.start(input)

Trim from the start of a string.

### trimNewlines.end(input)

Trim from the end of a string.


## 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 © [Sindre Sorhus](http://sindresorhus.com)

Version data entries

35 entries across 34 versions & 15 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/trim-newlines/readme.md
disco_app-0.18.0 test/dummy/node_modules/trim-newlines/readme.md
disco_app-0.18.2 test/dummy/node_modules/trim-newlines/readme.md
tang-0.2.1 spec/tang_app/node_modules/trim-newlines/readme.md
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/trim-newlines/readme.md
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/trim-newlines/readme.md
ruby2js-4.0.4 lib/tasks/testrails/node_modules/trim-newlines/readme.md
ruby2js-4.0.3 lib/tasks/testrails/node_modules/trim-newlines/readme.md
tang-0.2.0 spec/tang_app/node_modules/trim-newlines/readme.md
tang-0.1.0 spec/tang_app/node_modules/trim-newlines/readme.md
tang-0.0.9 spec/tang_app/node_modules/trim-newlines/readme.md
enju_library-0.3.8 spec/dummy/node_modules/trim-newlines/readme.md
ilog-0.4.1 node_modules/trim-newlines/readme.md
ilog-0.4.0 node_modules/trim-newlines/readme.md
ilog-0.3.3 node_modules/trim-newlines/readme.md
jester-data-8.0.0 node_modules/trim-newlines/readme.md
ezii-os-5.2.1 node_modules/trim-newlines/readme.md
ezii-os-2.0.1 node_modules/trim-newlines/readme.md
ezii-os-1.1.0 node_modules/trim-newlines/readme.md
ezii-os-1.0.0 node_modules/trim-newlines/readme.md