Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

trim-trailing-lines

1.1.1 • Public • Published

trim-trailing-lines Build Status Coverage Status

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,069,088

version

1.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability