Strip-final-newline is a small utility that removes only the final newline character from a string or Uint8Array, leaving other trailing whitespace intact. It is useful when parsing command output, such as fixing an extra newline at the end of stdout without removing all trailing newlines and spaces.
Project status
- This GitHub source is not actively maintained as of today (2026-06-09), since the last upstream push was on 2024-10-28, with no evidence of ongoing updates since then.
- The apparent update cadence is low, with major updates occurring in 2018 (v2.0.0), 2021 (v3.0.0), and 2023 (v4.0.0), and no recent evidence of frequent follow-up updates.
AI summary generated
Recent updates
v4.0.0
v4.0.0 updates strip-final-newline to require Node.js 18+, and adds TypeScript typings. It also changes the Uint8Array path to improve performance by returning a view rather than copying the underlying bytes.
BreakingFeaturesv3.0.0
v3.0.0 introduces breaking platform and module-system changes. You must use a newer Node.js runtime and migrate consumers to ESM, as the package is now pure ESM.
Breakingv2.0.0
Release v2.0.0 was published on 2018-10-28, but no release notes were provided by the publisher. As a result, no documented API, behavior, or migration changes can be reliably extracted from the release description.