1 # trim-newlines [![Build Status](https://travis-ci.org/sindresorhus/trim-newlines.svg?branch=master)](https://travis-ci.org/sindresorhus/trim-newlines)
3 > Trim [newlines](https://en.wikipedia.org/wiki/Newline) from the start and/or end of a string
9 $ npm install --save trim-newlines
16 const trimNewlines = require('trim-newlines');
18 trimNewlines('\nunicorn\r\n');
25 ### trimNewlines(input)
27 Trim from the start and end of a string.
29 ### trimNewlines.start(input)
31 Trim from the start of a string.
33 ### trimNewlines.end(input)
35 Trim from the end of a string.
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.
46 MIT © [Sindre Sorhus](https://sindresorhus.com)