npm

Don't miss out on this year's npm Pride t-shirt designs!Order your favorites here »

trim-trailing-lines

1.1.2 • Public • Published

trim-trailing-lines

Build Coverage Downloads Size

Remove final newline characters from a string.

Installation

npm:

npm install trim-trailing-lines

Usage

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 newline characters from value.

Parameters
  • value (string) — Value with trailing newlines, coerced to string.
Returns

string — Value without trailing newlines.

License

MIT © Titus Wormer

install

npm i trim-trailing-lines

Downloadsweekly downloads

1,264,588

version

1.1.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability