trim-newlines
Advanced tools
Trim newlines from the start and/or end of a string
Weekly downloads
Changelog
https://github.com/sindresorhus/trim-newlines/compare/v4.0.1...v4.0.2
Readme
Trim newlines from the start and/or end of a string
$ npm install trim-newlines
import trimNewlines from 'trim-newlines';
trimNewlines('\nš¦\r\n');
//=> 'š¦'
trimNewlines.start('\nš¦\r\n');
//=> 'š¦\r\n'
trimNewlines.end('\nš¦\r\n');
//=> '\nš¦'
Trim from the start and end of a string.
Trim from the start of a string.
Trim from the end of a string.
String#trim()
but removes only whitespace on the leftString#trim()
but removes only whitespace on the right.Trim newlines from the start and/or end of a string
The npm package trim-newlines receives a total of 12,493,997 weekly downloads. As such, trim-newlines popularity was classified as popular.
We found that trim-newlines demonstrated a not healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.