trim-newlines efficiently removes leading and trailing newline characters from a string. It offers a simple, focused solution for sanitizing text where extraneous newlines are problematic. This package distinguishes itself by its minimal footprint and ease of use, integrating seamlessly into projects requiring string cleanup. Ideal for handling user input, processing files, or preparing data for consistent formatting. A lightweight dependency ensuring clean, predictable string manipulation.
The npm package trim-newlines has infrequent releases. Initial release was in September 2015. There were releases in April 2017, April 2019, April, May and June 2021, and March 2023. The latest version, 5.0.0, was released in March 2023. No releases have occurred since March 2023.
Trim-newlines downloads surged in early 2024, peaking around 62 million monthly. A massive spike hit in June 2025 (92 million), with July remaining high (82 million). August 2025 downloads show a significant drop (43 million), but represent only partial month data.