Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

trim-trailing-lines

1.1.3 • Public • Published

trim-trailing-lines

Build Coverage Downloads Size

Remove final line feeds from a string.

Install

npm:

npm install trim-trailing-lines

Use

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 © Titus Wormer

Install

npm i trim-trailing-lines

DownloadsWeekly Downloads

1,809,371

Version

1.1.3

License

MIT

Unpacked Size

4.72 kB

Total Files

4

Last publish

Collaborators

  • avatar