Back to Explore

sindresorhus/strip-final-newline

GitHub
1 watchersOpen source

Last release: 12/13/2023

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

  • The repository appears actively maintained, with the latest known upstream push on 2024-10-28 and recent changes including a major v4.0.0 update.
  • Apparent update cadence is low, with major version updates in 2021 (v3.0.0) and 2023 (v4.0.0), suggesting a relatively stable maintenance pace rather than frequent feature releases.

AI summary generated Today

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v4.0.0

    12/13/2023

    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.

    BreakingFeatures
  • v3.0.0

    5/3/2021

    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.

    Breaking