You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
![]() |
5 years ago | |
---|---|---|
.. | ||
index.js | 5 years ago | |
license | 5 years ago | |
package.json | 5 years ago | |
readme.md | 5 years ago |
readme.md
trim-trailing-lines
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.