Sha256: fb62f20bc5aa5108d1d7901f2cc7c9c46f4fb0a9a048a5f893dbe5fea705b768

Contents?: true

Size: 1.45 KB

Versions: 23

Compression:

Stored size: 1.45 KB

Contents

# trim-trailing-lines

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Remove final line feeds from a string.

## Install

[npm][]:

```sh
npm install trim-trailing-lines
```

## Use

```js
var trimTrailingLines = require('trim-trailing-lines')

trimTrailingLines('foo\nbar') // => 'foo\nbar'
trimTrailingLines('foo\nbar\n') // => 'foo\nbar'
trimTrailingLines('foo\nbar\n\n') // => 'foo\nbar'
```

## API

### `trimTrailingLines(value)`

Remove final line feed characters from `value`.

###### Parameters

*   `value` (`string`) — Value with trailing line feeds, coerced to string.

###### Returns

`string` — Value without trailing newlines.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/wooorm/trim-trailing-lines.svg

[build]: https://travis-ci.org/wooorm/trim-trailing-lines

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/trim-trailing-lines.svg

[coverage]: https://codecov.io/github/wooorm/trim-trailing-lines

[downloads-badge]: https://img.shields.io/npm/dm/trim-trailing-lines.svg

[downloads]: https://www.npmjs.com/package/trim-trailing-lines

[size-badge]: https://img.shields.io/bundlephobia/minzip/trim-trailing-lines.svg

[size]: https://bundlephobia.com/result?p=trim-trailing-lines

[npm]: https://docs.npmjs.com/cli/install

[license]: license

[author]: https://wooorm.com

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
trusty-cms-5.0.7 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.6 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.5 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.4 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.3 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.2 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.1 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.3.5 node_modules/trim-trailing-lines/readme.md
trusty-cms-5.0.0 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.3.4 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.3.3 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.3.2 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.3.1 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.3 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.2.3 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.2.2 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.2.1 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.2 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.1.9 node_modules/trim-trailing-lines/readme.md
trusty-cms-4.1.8 node_modules/trim-trailing-lines/readme.md